GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.
Bug 32139 - [4.1 Regression] ICE in mark_operand_necessary
Summary: [4.1 Regression] ICE in mark_operand_necessary
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: alias, ice-on-valid-code
Depends on: 34768
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-29 13:32 UTC by Jakub Jelinek
Modified: 2008-07-04 16:07 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.4 4.2.0
Known to fail: 4.1.3
Last reconfirmed: 2008-01-13 14:36:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2007-05-29 13:32:13 UTC
int foo (void);
int bar (void) __attribute__((const));

int
test (int x)
{
  int a = (x == 10000 ? foo : bar) ();
  int b = (x == 10000 ? foo : bar) ();
  return a + b;
}
ICEs in mark_operand_necessary.
3.4.x works and so does 4.2 and trunk.

Related to in PR29382 described common_pointer_type, but perhaps not just that.
Comment 1 Richard Biener 2008-01-13 14:36:09 UTC
./cc1 -quiet t.c -O2
t.c: In function ‘test’:
t.c:6: internal compiler error: tree check: expected ssa_name, have var_decl in mark_operand_necessary, at tree-ssa-pre.c:2460
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

we have unrenamed VOPs on code inserted by PRE.

#   TMT.7D.1301 = V_MAY_DEF <TMT.7D.1301>;
D.1324_9 = foo ()


4.2 ICEs once you try to do -fdump-tree-all-vops:

t.c: In function ‘test’:
t.c:6: internal compiler error: in stmt_ann, at tree-flow-inline.h:173
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>.

note that VOPs are missing from the indirect function call before PRE:

<L2>:;
  #   VUSE <NONLOCAL.7_12>;
  #   VUSE <NONLOCAL.14_1>;
  #   VUSE <NONLOCAL.20_7>;
  #   VUSE <NONLOCAL.26_13>;
  #   VUSE <NONLOCAL.32_14>;
  a_6 = foo ();

  # a_4 = PHI <a_6(3), a_5(5)>;
  # iftmp.1_2 = PHI <foo(3), bar(5)>;
<L5>:;
  b_9 = iftmp.1_2 ();

(likewise in the 4.1 and 4.3 case).
Comment 2 Joseph S. Myers 2008-07-04 16:07:08 UTC
Closing 4.1 branch.
Comment 3 uros 2009-03-25 07:59:10 UTC
Subject: Bug 32139

Author: uros
Date: Wed Mar 25 07:58:55 2009
New Revision: 145052

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145052
Log:
	PR c/27898
	* gcc.dg/pr27898.c: New test.

	PR tree-optimization/32139
	* gcc.c-torture/compile/pr32139.c: New test.


Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr32139.c
    trunk/gcc/testsuite/gcc.dg/pr27898.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog