diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-03 20:34:31 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-03 20:34:31 +0000 |
commit | 4497b2ae45eb617c418719053c43fc17841cc5b0 (patch) | |
tree | 892b45fd16cf2c42639551c3f8013562fae34414 /gcc/testsuite/gcc.c-torture | |
parent | 4f1591c2055c1acbec3e5e75f8927838fde8c382 (diff) | |
download | gcc-4497b2ae45eb617c418719053c43fc17841cc5b0.tar.gz |
* ifcvt.c (noce_try_store_flag, noce_try_store_flag_constants,
noce_try_store_flag_inc, noce_try_store_flag_mask, noce_try_cmove,
noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Insert new
code before JUMP, not EARLIEST.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53123 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20020503-1.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020503-1.c b/gcc/testsuite/gcc.c-torture/execute/20020503-1.c new file mode 100644 index 00000000000..6d45ca09af0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020503-1.c @@ -0,0 +1,31 @@ +/* PR 6534 */ +/* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i) + insertted the code at the wrong place corrupting the i<0 test. */ + +void abort (void); +static char * +inttostr (long i, char buf[128]) +{ + unsigned long ui = i; + char *p = buf + 127; + *p = '\0'; + if (i < 0) + ui = -ui; + do + *--p = '0' + ui % 10; + while ((ui /= 10) != 0); + if (i < 0) + *--p = '-'; + return p; +} + +int +main () +{ + char buf[128], *p; + + p = inttostr (-1, buf); + if (*p != '-') + abort (); + return 0; +} |