Commit 486bc847 by Richard Biener Committed by Richard Biener

re PR middle-end/67271 (ICE with -O1,2,3 on darwin14.5 x86_64)

2015-09-16  Richard Biener  <rguenther@suse.de>

	PR middle-end/67271
	* fold-const.c (native_encode_expr): Bail out on bogus offsets.

	* gcc.dg/pr67271.c: New testcase.

From-SVN: r227825
parent b0463d3d
2015-09-16 Richard Biener <rguenther@suse.de>
PR middle-end/67271
* fold-const.c (native_encode_expr): Bail out on bogus offsets.
2015-09-16 Eric Botcazou <ebotcazou@adacore.com>
* tree-ssa-sccvn.c (ao_ref_init_from_vn_reference): Use offset_int for
......
......@@ -7110,6 +7110,10 @@ native_encode_string (const_tree expr, unsigned char *ptr, int len, int off)
int
native_encode_expr (const_tree expr, unsigned char *ptr, int len, int off)
{
/* We don't support starting at negative offset and -1 is special. */
if (off < -1)
return 0;
switch (TREE_CODE (expr))
{
case INTEGER_CST:
......
2015-09-16 Richard Biener <rguenther@suse.de>
PR middle-end/67271
* gcc.dg/pr67271.c: New testcase.
2015-09-16 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt49.adb: New test.
......
/* { dg-do compile } */
/* { dg-options "-O" } */
extern long int labs (long int j);
int
main ()
{
long *a = (long *)"empty";
int i = 1441516387;
a[i] = labs (a[i]);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment