Commit eab1da69 by Uros Bizjak

[multiple changes]

2010-11-29  Zdenek Dvorak  <rakdver@kam.uniff.cz>

	PR tree-optimization/46675
	* tree-ssa-loop-niter.c (split_to_var_and_offset): Avoid overflow
	in offset calculation.

testsuite/ChangeLog:

2010-11-29  Richard Guenther  <rguenther@suse.de>
	    Zdenek Dvorak  <rakdver@kam.uniff.cz>

	PR tree-optimization/46675
	* gcc.dg/pr46675.c: New test.

From-SVN: r167256
parent 37fc948f
2010-11-29 Zdenek Dvorak <rakdver@kam.uniff.cz>
PR tree-optimization/46675
* tree-ssa-loop-niter.c (split_to_var_and_offset): Avoid overflow
in offset calculation.
2010-11-29 Jan Hubicka <jh@suse.cz> 2010-11-29 Jan Hubicka <jh@suse.cz>
* collect2.c (main): Do not imply verbose output with LTO and linker plugin. * collect2.c (main): Do not imply verbose output with
LTO and linker plugin.
2010-11-29 Dodji Seketeli <dodji@redhat.com> 2010-11-29 Dodji Seketeli <dodji@redhat.com>
...@@ -78,8 +85,7 @@ ...@@ -78,8 +85,7 @@
2010-11-29 Joseph Myers <joseph@codesourcery.com> 2010-11-29 Joseph Myers <joseph@codesourcery.com>
* system.h: Include "safe-ctype.h" instead of <safe-ctype.h>. * system.h: Include "safe-ctype.h" instead of <safe-ctype.h>.
Include <signal.h>, <sys/mman.h>, <sys/resource.h> and Include <signal.h>, <sys/mman.h>, <sys/resource.h> and <sys/times.h>.
<sys/times.h>.
(O_BINARY, SIGCHLD, MAP_FAILED, MAP_ANONYMOUS, kill): (O_BINARY, SIGCHLD, MAP_FAILED, MAP_ANONYMOUS, kill):
Conditionally define. Conditionally define.
(GET_ENVIRONMENT): Poison. (GET_ENVIRONMENT): Poison.
...@@ -111,8 +117,7 @@ ...@@ -111,8 +117,7 @@
* config/microblaze/microblaze.c: Don't include <signal.h>. * config/microblaze/microblaze.c: Don't include <signal.h>.
* config/mips/mips.c: Don't include <signal.h>. * config/mips/mips.c: Don't include <signal.h>.
* config/rs6000/host-darwin.c: Don't include <signal.h>. * config/rs6000/host-darwin.c: Don't include <signal.h>.
* cppdefault.c (cpp_relocated): Use getenv instead of * cppdefault.c (cpp_relocated): Use getenv instead of GET_ENVIRONMENT.
GET_ENVIRONMENT.
* defaults.h (GET_ENVIRONMENT): Don't define. * defaults.h (GET_ENVIRONMENT): Don't define.
* et-forest.h: Don't include <ansidecl.h> or <stddef.h>. * et-forest.h: Don't include <ansidecl.h> or <stddef.h>.
* gcc.c: Don't include <signal.h>, <sys/mman.h> or <sys/types.h>. * gcc.c: Don't include <signal.h>, <sys/mman.h> or <sys/types.h>.
...@@ -127,10 +132,8 @@ ...@@ -127,10 +132,8 @@
* ggc-zone.c: Don't include <sys/mman.h>. * ggc-zone.c: Don't include <sys/mman.h>.
(MAP_ANONYMOUS, MAP_FAILED): Don't define. (MAP_ANONYMOUS, MAP_FAILED): Don't define.
* graph.c: Include "config.h" instead of <config.h>. * graph.c: Include "config.h" instead of <config.h>.
* incpath.c (add_env_var_paths): Use getenv instead of * incpath.c (add_env_var_paths): Use getenv instead of GET_ENVIRONMENT.
GET_ENVIRONMENT. * lto-wrapper.c: Don't include <errno.h>, <signal.h> or "libiberty.h".
* lto-wrapper.c: Don't include <errno.h>, <signal.h> or
"libiberty.h".
(SIGCHLD, kill): Don't define. (SIGCHLD, kill): Don't define.
* mips-tfile.c: Don't include <signal.h>. * mips-tfile.c: Don't include <signal.h>.
* opts.c: Don't include <signal.h> or <sys/resource.h>. * opts.c: Don't include <signal.h> or <sys/resource.h>.
2010-11-29 Richard Guenther <rguenther@suse.de>
Zdenek Dvorak <rakdver@kam.uniff.cz>
PR tree-optimization/46675
* gcc.dg/pr46675.c: New test.
2010-11-29 Iain Sandoe <iains@gcc.gnu.org> 2010-11-29 Iain Sandoe <iains@gcc.gnu.org>
* gcc/testsuite/objc.dg/strings-1.m: Move to... * gcc/testsuite/objc.dg/strings-1.m: Move to...
...@@ -15,14 +21,15 @@ ...@@ -15,14 +21,15 @@
PR c++/42260 PR c++/42260
* g++.dg/conversion/cast2.C: New test. * g++.dg/conversion/cast2.C: New test.
* g++.dg/conversion/cond4/C: Likewise. This ensures we don't regress on
PR c++/45383 PR c++/45383
* g++.dg/conversion/cond4.C: Likewise.
2010-11-29 Dodji Seketeli <dodji@redhat.com> 2010-11-29 Dodji Seketeli <dodji@redhat.com>
PR c++/45383 PR c++/45383
Reverted patch for PR c++/42260 Reverted patch for PR c++/42260
* conversion/cast2.C: Reverted new test. * g++.dg/conversion/cast2.C: Reverted new test.
2010-11-29 Dodji Seketeli <dodji@redhat.com> 2010-11-29 Dodji Seketeli <dodji@redhat.com>
......
/* { dg-do run } */
/* { dg-options "-O2" } */
extern void abort (void);
int j;
void
__attribute__((noinline))
foo (int n)
{
int npairs, i;
npairs = n - (-__INT_MAX__ - 1);
if (npairs > 0)
for (i = 0; i < npairs; i++)
j++;
}
int
main ()
{
foo (5 - __INT_MAX__ - 1);
if (j != 5)
abort ();
return 0;
}
...@@ -95,10 +95,10 @@ split_to_var_and_offset (tree expr, tree *var, mpz_t offset) ...@@ -95,10 +95,10 @@ split_to_var_and_offset (tree expr, tree *var, mpz_t offset)
*var = op0; *var = op0;
/* Always sign extend the offset. */ /* Always sign extend the offset. */
off = tree_to_double_int (op1); off = tree_to_double_int (op1);
if (negate)
off = double_int_neg (off);
off = double_int_sext (off, TYPE_PRECISION (type)); off = double_int_sext (off, TYPE_PRECISION (type));
mpz_set_double_int (offset, off, false); mpz_set_double_int (offset, off, false);
if (negate)
mpz_neg (offset, offset);
break; break;
case INTEGER_CST: case INTEGER_CST:
......
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