[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #8 from spark at gcc dot gnu dot org 2007-03-13 23:43 --- I believe all issues are fixed at this point, except for the extra error message of can't find a register. But since it's accompanied with a proper error message, I don't think this is a problem anymore. $gcc -fPIC -fomit-frame-pointer -O2 -S t.c grep DEBUG t.s #DEBUG %0=(%esp), clobber: %ebp, ... $gcc -DNBEFORE=1 -fPIC -fomit-frame-pointer -O2 -S t.c grep DEBUG t.s #DEBUG %0=(%esp), clobber: %ebp, ... $gcc-O1 -S t.c $@ grep DEBUG t.s t.c: In function 'test_function': t.c:15: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' t.c:15: error: 'asm' operand has impossible constraints $gcc -O1 -fPIC -S t.c $@ grep DEBUG t.s t.c: In function 'test_function': t.c:20: error: bp cannot be used in asm here t.c:15: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' t.c:15: error: 'asm' operand has impossible constraints $gcc -fPIC -O0 -S t.c grep DEBUG t.s t.c: In function 'test_function': t.c:20: error: bp cannot be used in asm here $gcc -fPIC -O0 -S t.c -fomit-frame-pointer grep DEBUG t.s #DEBUG %0=12(%esp), clobber: %ebp, ... -- spark at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #7 from spark at gcc dot gnu dot org 2007-02-06 19:43 --- Subject: Bug 28686 Author: spark Date: Tue Feb 6 19:43:41 2007 New Revision: 121663 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=121663 Log: 2007-02-06 Seongbae Park [EMAIL PROTECTED] PR inline-asm/28686 * global.c (compute_regsets): New function. (global_alloc): Refactored ELIMINABLE_REGSET and NO_GLOBAL_ALLOC_REGS computation out. (rest_of_handle_global_alloc): Call compute_regsets() for non-optimizing case. Modified: trunk/gcc/ChangeLog trunk/gcc/global.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #5 from spark at gcc dot gnu dot org 2007-02-01 17:47 --- -O1 error problem is due to constant assignment of var. If you replace: long var = 42; with something like: long var = func(); It compiles without an error (though it still has the #3 problem of using %ebp even though it's marked clobbered). This is a corner case for reload, because it knows the register contains a constant, and thinks there will be at least some scratch register to load it to. Unfortunately, due to the problematic asm statement having clobbers for all registers (except %ebp, but %ebp is not available for general allocation without -fomit-frame-pointer) there's no register available to load the constant to. So, the workaround for this problem is to have a local variable that's not initialized from a constant. So I'm deferring this #2 problem, and will take a look at #3 now. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #6 from spark at gcc dot gnu dot org 2007-02-01 23:15 --- Subject: Bug 28686 Author: spark Date: Thu Feb 1 23:15:13 2007 New Revision: 121477 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=121477 Log: 2007-2-01 Seongbae Park [EMAIL PROTECTED] PR inline-asm/28686 * global.c (global_alloc): Add mising initialization of ELIMINABLE_REGSET. 2007-02-01 Roger Sayle [EMAIL PROTECTED] Modified: trunk/gcc/ChangeLog trunk/gcc/global.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
-- ian at airs dot com changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-01-30 19:09:28 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #3 from michael dot meissner at amd dot com 2007-01-30 20:17 --- Created an attachment (id=12982) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12982action=view) Secondary error Note, this is 32-bit only. If you compile epb2.c with -fpic -m32 and no optimization, it generates incorrect code, in that at -O0 it does not omit the frame pointer, but the asm is claimed to clobber %ebp, and subsequent local variables will use %ebp. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
-- spark at gcc dot gnu dot org changed: What|Removed |Added CC|seongbae dot park at gmail | |dot com | AssignedTo|unassigned at gcc dot gnu |spark at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2007-01-30 19:09:28 |2007-01-30 21:43:48 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #4 from spark at gcc dot gnu dot org 2007-01-31 00:28 --- Looks like eliminable_regset is not cleared per every invocation of global_alloc, making stale bits from the compilation of previous function hang around - hence a presence of a previous function makes difference. Following patch seems to fix -O2 problem. I'm now on to -O1 and -O0 issues. Index: global.c === --- global.c(revision 121353) +++ global.c(working copy) @@ -354,6 +354,7 @@ global_alloc (void) are safe to use only within a basic block. */ CLEAR_HARD_REG_SET (no_global_alloc_regs); + CLEAR_HARD_REG_SET (eliminable_regset); /* Build the regset of all eliminable registers and show we can't use those that we already know won't be eliminated. */ @@ -2548,4 +2549,3 @@ struct tree_opt_pass pass_global_alloc = TODO_ggc_collect, /* todo_flags_finish */ 'g' /* letter */ }; - -- spark at gcc dot gnu dot org changed: What|Removed |Added CC||spark at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #2 from Martin dot vGagern at gmx dot net 2007-01-25 11:06 --- As this has been unconfirmed for so long and should be relatively easy to confirm, here are the commands to reproduce the problems above: gcc -fPIC -fomit-frame-pointer -O2 -S ebp.c grep DEBUG ebp.s gcc-O1 -S ebp.c grep DEBUG ebp.s gcc -fPIC -O0 -S ebp.c grep DEBUG ebp.s In case you want to reproduce all the combinations given in the table at the end of my source file, you can use this bash loop: for ((i=0; i 32; ++i)); do ARGS=-O$((i%4)); ARGS=$( [[ $((i4)) -eq 0 ]] || echo -fomit-frame-pointer )$ARGS; ARGS=$( [[ $((i8)) -eq 0 ]] || echo -fPIC )$ARGS; ARGS=$( [[ $((i16)) -eq 0 ]] || echo -DNBEFORE )$ARGS; echo -- $ARGS --; gcc $ARGS -S ebp.c grep DEBUG ebp.s done It might be you can reproduce this behaviour, but are not certain it is a bug. I can understand you might doubt a single of my three mentioned problems, but do you really believe they are all three as things should be? If in doubt, perhaps best concentrate on problem 1, ebp being clobbered and still used. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686
[Bug inline-asm/28686] ebp from clobber list used as operand
--- Comment #1 from Martin dot vGagern at gmx dot net 2006-08-10 19:49 --- Created an attachment (id=12058) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12058action=view) Test case including compilation result table This is the above test case, and appended is a table matching compiler flags to error messages or register allocation information. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28686