Bug 22319 - [4.1 Regression] tree check: expected integer_cst, have cond_expr tree-ssa-structalias.c:2410
: [4.1 Regression] tree check: expected integer_cst, have cond_expr tree-ssa-st...
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: tree-optimization
: 4.1.0
: P2 normal
: 4.1.0
Assigned To: Not yet assigned to anyone
:
: build, ice-on-valid-code
: 22140
:
  Show dependency treegraph
 
Reported: 2005-07-06 01:52 UTC by John David Anglin
Modified: 2005-07-06 17:31 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-06 12:20:52


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2005-07-06 01:52:40 UTC
../../xgcc -B../../  -c -g -O2 -fPIC -DELF=1 -DLINUX=1      -W -Wall -gnatpg 
g-
socket.adb -o g-socket.o
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050705 (experimental) (hppa-unknown-linux-gnu) GCC error:        |
| tree check: expected integer_cst, have cond_expr in                      |
|    do_structure_copy, at tree-ssa-structalias.c:2410                     |
| Error detected at g-socket.adb:2246:1                                    |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.

Doesn't fail at -O0.
Comment 1 Andrew Pinski 2005-07-06 01:59:31 UTC
And I just ran into this too.
Comment 2 Andrew Pinski 2005-07-06 02:05:08 UTC
This looks like PR 22140.
Comment 3 Laurent GUERBY 2005-07-06 12:20:43 UTC
It has also been reported on ia64-linux by Geert.

http://gcc.gnu.org/ml/gcc/2005-07/msg00209.html

bt on my x86_64-linux machine

#0  internal_error (gmsgid=0xb4e6c0 "tree check: %s, have %s in %s, at %s:%d")
at /home/guerby/work/gcc/version-head/gcc/diagnostic.c:530
#1  0x00000000008e793d in tree_check_failed (node=0x2a9661fe10, file=0xb53dd0
"/home/guerby/work/gcc/version-head/gcc/tree-ssa-structalias.c", line=2410,
function=0xcc2490 "do_structure_copy")
    at /home/guerby/work/gcc/version-head/gcc/tree.c:5612
#2  0x000000000092817e in do_structure_copy (lhsop=0x2a95c9f240,
rhsop=0x2a95c9e270) at
/home/guerby/work/gcc/version-head/gcc/tree-ssa-structalias.c:2410
#3  0x00000000009284b6 in find_func_aliases (t=0x2a95ca0320) at
/home/guerby/work/gcc/version-head/gcc/tree-ssa-structalias.c:2495
#4  0x000000000092b51b in create_alias_vars () at
/home/guerby/work/gcc/version-head/gcc/tree-ssa-structalias.c:3201
#5  0x0000000000910cc6 in execute_one_pass (pass=0xcc27c0) at
/home/guerby/work/gcc/version-head/gcc/passes.c:776
#6  0x0000000000910dec in execute_pass_list (pass=0xcc27c0) at
/home/guerby/work/gcc/version-head/gcc/passes.c:808
#7  0x0000000000910dfe in execute_pass_list (pass=0xcb0040) at
/home/guerby/work/gcc/version-head/gcc/passes.c:809
#8  0x000000000064a7e5 in tree_rest_of_compilation (fndecl=0x2a9677c5b0) at
/home/guerby/work/gcc/version-head/gcc/tree-optimize.c:419
#9  0x000000000041bfa3 in gnat_expand_body (gnu_decl=0x2a9677c5b0) at
/home/guerby/work/gcc/version-head/gcc/ada/misc.c:636
#10 0x0000000000957cb6 in cgraph_expand_function (node=0x2a959da340) at
/home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1033
#11 0x0000000000959b26 in cgraph_optimize () at
/home/guerby/work/gcc/version-head/gcc/cgraphunit.c:1099
#12 0x000000000041b49a in gnat_parse_file (set_yydebug=Variable "set_yydebug" is
not available.
Comment 4 Andrew Pinski 2005-07-06 13:37:52 UTC
I can confirm this is fixed by the patch for PR 22140, posted here: 
http://gcc.gnu.org/ml/gcc/2005-07/msg00216.html
Comment 5 CVS Commits 2005-07-06 16:50:25 UTC
Subject: Bug 22319

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dberlin@gcc.gnu.org	2005-07-06 16:50:00

Modified files:
	gcc            : ChangeLog tree-ssa-structalias.c 

Log message:
	2005-07-06  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR tree-optimization/22319
	Fix PR tree-optimization/22140
	Fix PR tree-optimization/22310
	
	* tree-ssa-structalias.c (do_structure_copy): Give up earlier on
	variable sized types.
	Use correct type for intermediate structure on *a = *b structure
	copies.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9356&r2=2.9357
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-structalias.c.diff?cvsroot=gcc&r1=2.12&r2=2.13

Comment 6 Andrew Pinski 2005-07-06 17:31:46 UTC
Fixed.