[Bug regression/55168] New: [4.8 Regression]: gcc.c-torture/compile/pr44119.c ICE, all but -O0

2012-11-01 Thread hp at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55168



 Bug #: 55168

   Summary: [4.8 Regression]: gcc.c-torture/compile/pr44119.c ICE,

all but -O0

Classification: Unclassified

   Product: gcc

   Version: 4.7.0

Status: UNCONFIRMED

  Keywords: ice-on-valid-code

  Severity: normal

  Priority: P3

 Component: regression

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: h...@gcc.gnu.org

CC: ste...@gcc.gnu.org

  Host: x86_64-unknown-linux-gnu

Target: cris-axis-elf





This test previously passed, now it fails.

A patch in the revision range (last_known_working:first_known_failing)

193042:193049

exposed or caused this regression.  Since then it fails as follows:



Running

/tmp/hpautotest-gcc0/gcc/gcc/testsuite/gcc.c-torture/compile/compile.exp ...

FAIL: gcc.c-torture/compile/pr44119.c  -O1  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O1  (test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O2  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O2  (test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -fomit-frame-pointer  (internal

compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -fomit-frame-pointer  (test for

excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -fomit-frame-pointer -funroll-loops 

(internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -fomit-frame-pointer -funroll-loops 

(test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -fomit-frame-pointer

-funroll-all-loops -finline-functions  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -fomit-frame-pointer

-funroll-all-loops -finline-functions  (test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -g  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O3 -g  (test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -Os  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -Os  (test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O2 -flto -fno-use-linker-plugin

-flto-partition=none  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O2 -flto -fno-use-linker-plugin

-flto-partition=none  (test for excess errors)

FAIL: gcc.c-torture/compile/pr44119.c  -O2 -flto -fuse-linker-plugin

-fno-fat-lto-objects  (internal compiler error)

FAIL: gcc.c-torture/compile/pr44119.c  -O2 -flto -fuse-linker-plugin

-fno-fat-lto-objects  (test for excess errors)



The messages in gcc.log are similar:



Executing on host: /tmp/hpautotest-gcc0/cris-elf/gccobj/gcc/xgcc

-B/tmp/hpautotest-gcc0/cris-elf/gccobj/gcc/  -fno-diagnostics-show-caret   -O1 

-w -c   -isystem

/tmp/hpautotest-gcc0/cris-elf/gccobj/cris-elf/./newlib/targ-include -isystem

/tmp/hpautotest-gcc0/gcc/newlib/libc/include  -o pr44119.o

/tmp/hpautotest-gcc0/gcc/gcc/testsuite/gcc.c-torture/compile/pr44119.c   

(timeout = 300)

/tmp/hpautotest-gcc0/gcc/gcc/testsuite/gcc.c-torture/compile/pr44119.c: In

function 'func_96':



/tmp/hpautotest-gcc0/gcc/gcc/testsuite/gcc.c-torture/compile/pr44119.c:45:1:

internal compiler error: Floating point exception



0x84ab35 crash_signal



/tmp/hpautotest-gcc0/gcc/gcc/toplev.c:333



0x7d4bbf predict_loops



/tmp/hpautotest-gcc0/gcc/gcc/predict.c:1524



0x7d67b4 tree_estimate_probability()



/tmp/hpautotest-gcc0/gcc/gcc/predict.c:2259



0x7d75d4 tree_estimate_probability_driver



/tmp/hpautotest-gcc0/gcc/gcc/predict.c:2296





Author of only suspect patch in revision range CC:ed.


Re: [Bug regression/55168] New: [4.8 Regression]: gcc.c-torture/compile/pr44119.c ICE, all but -O0

2012-11-01 Thread Jan Hubicka
This actually looks like a previously latent issue in predict.c For all but
estimate_num_iterations_int.  It uses the funny definition of number of
iterations (i.e. 0 means that loop will exit at first invocation of the exit
condition and that is what it will be predicted with when nitercst == 1.

Index: predict.c
===
--- predict.c   (revision 193062)
+++ predict.c   (working copy)
@@ -1433,8 +1437,8 @@ predict_loops (void)
 the loop, use it to predict this exit.  */
  else if (n_exits == 1)
{
- nitercst = estimated_stmt_executions_int (loop);
- if (nitercst  0)
+ nitercst = estimated_stmt_executions_int (loop) + 1;
+ if (nitercst = 0)
continue;
  if (nitercst  max)
nitercst = max;