Found builing frv-elf gdb with tree-ssa compiler. I'll upload the .i file. $ gcc --version gcc (GCC) 3.5-tree-ssa 20031123 (merged 20031111) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ gcc -O1 -c completer.i symbol_start_213 is defined in BB19, by: symbol_start_213 = pretmp.261_30 It is also live-on-entry to entry BB 0 So it appears to have multiple defs. ../../src/HEAD-2003-11-23/gdb/completer.c: In function `location_completer': ../../src/HEAD-2003-11-23/gdb/completer.c:200: internal compiler error: in calculate_live_on_entry, at tree-ssa-live.c:753 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 5205 [details] Preprocessed source
I'm also seeing this bug building gdb for mn10300-elf, sh-elf, sh64-elf, mips-elf, and v850-elf.
Confirmed. Test case: void make_file_symbol_completion_list (char *); void location_completer (char *text) { char *p, *symbol_start = text; for (p = text; *p != '\0'; ++p) { if (*p == '\\' && p[1] == '\'') p++; else if (*p == ':') symbol_start = p + 1; else symbol_start = p + 1; make_file_symbol_completion_list(symbol_start); } } Needs -O.
THis appears to be a bug in PRE. I traced out the basic block flow, and PRE has apparently inserted the specified stmt (p_201 = pretmp.344_32) in BB 9. p_201 is only used in a PHI node in block 25: # BLOCK 25 # PRED: 18 (false,exec) 23 (false,exec) 55 53 24 (fallthru,exec) # pretmp.344_34 = PHI <p_201(18), p_201(24), pretmp.344_68(53), pretmp.344_79(55), pretmp.344_32(23)>; I can trace a path from BB0 to BB25 through BB18 which does not include BB9, and so p_201 is undefined on that path: BB0->BB3->BB26->BB4->BB5->BB7->BB8->BB17->BB18->BB25 So the error is correct, The assignment is incorrectly placed for some reason. The problem goes away with -fno-tree-pre. Andrew PS, with the enw smaller testcase, the same thing can be seen: # BLOCK 4 # PRED: 2 (true,exec) 3 # pretmp.4_5 = PHI <pretmp.4_25(3), pretmp.4_26(2)>; <L3>:; if (T.1_13 == 58) goto <L6>; else goto <L5>; # SUCC: 5 (false,exec) 6 (true,exec) # BLOCK 5 # PRED: 4 (false,exec) <L5>:; symbol_start_20 = pretmp.4_5; # SUCC: 6 (fallthru,exec) # BLOCK 6 # PRED: 4 (true,exec) 9 5 (fallthru,exec) # symbol_start_1 = PHI <symbol_start_2(9), pretmp.4_5(4), pretmp.4_5(5)>; # pretmp.4_6 = PHI <symbol_start_20(4), pretmp.4_5(5), pretmp.4_24(9)>; <L6>:; The assignemnt symbol_start_20 is in block 5, but it is used in the PHI node coming from block 4. Andrew
dberlin is the PRE guy, he should look into.
Subject: Bug 13177 CVSROOT: /cvs/gcc Module name: gcc Branch: tree-ssa-20020619-branch Changes by: dberlin@gcc.gnu.org 2003-12-03 23:35:52 Modified files: gcc : ChangeLog.tree-ssa tree-ssa-pre.c Log message: 2003-12-03 Daniel Berlin <dberlin@dberlin.org> Fix PR 13177 * tree-ssa-pre.c (code_motion): Do phi nodes last, and rearrange how we decide what temporary to choose so that we get it right. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.960&r2=1.1.2.961 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-pre.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.112&r2=1.1.4.113
Subject: Bug 13177 CVSROOT: /cvs/gcc Module name: gcc Branch: tree-ssa-20020619-branch Changes by: dberlin@gcc.gnu.org 2003-12-03 23:37:48 Added files: gcc/testsuite/gcc.c-torture/compile: 20031203-1.c Log message: Testcase for PR 13177 fix Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20031203-1.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1
Fixed.