public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad
@ 2005-08-19 11:09 jakub at redhat dot com
  2005-08-19 11:28 ` [Bug rtl-optimization/23478] " jakub at redhat dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: jakub at redhat dot com @ 2005-08-19 11:09 UTC (permalink / raw)
  To: gcc-bugs

The following testcase is miscompiled on x86_64-linux at -O2.
Before global alloc/reload, the interesting part of code is:
(reg:DI %rax) = (call _Znwm (1))
(reg:DI 81) = (reg:DI %rax)
...
(reg:DI %rdi) = (reg:DI 81)
(call _ZN2C1C1ERK2C3S2_S2_RPS1_ (%rdi, ...)) - may throw, EH pad .Leh
...
(reg:DI %rdi) = (reg:DI 81)
...
(barrier)
.Leh:
(reg:DI %rdi) = (reg:DI 81)
(call _ZdlPv (%rdi))

Now, as the register preassure is pretty high, there don't appear to be any
free usable call saved registers for pseudo 81, so global alloc assigns pseudo
81 into (reg:DI %r10), which is call clobbered.  Then reload saves it into stack
before the _ZN2C1C1ERK2C3S2_S2_RPS1_ call and restores it from the stack slot
after the call.  But doesn't restore it on the EH path as well.
So we end up with:
(reg:DI %rax) = (call _Znwm (1))
(reg:DI %r10 (81)) = (reg:DI %rax)
...
(reg:DI %rdi) = (reg:DI %r10 (81))
(mem:DI %rsp+24) = (reg:DI %r10 (81))
(call _ZN2C1C1ERK2C3S2_S2_RPS1_ (%rdi, ...)) - may throw, EH pad .Leh
(reg:DI %r10 (81)) = (mem:DI %rsp+24)
...
(reg:DI %rdi) = (reg:DI %r10 (81))
...
(barrier)
.Leh:
(reg:DI %rdi) = (reg:DI %r10 (81))
(call _ZdlPv (%rdi))

As this is a reload bug, it is not reproduceable on != 3.4.x compilers I have
tried, which doesn't mean the bug is present on 3.4.x only though.

-- 
           Summary: Miscompilation due to reloading of a var that is also
                    used in EH pad
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86_64-linux


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
@ 2005-08-19 11:28 ` jakub at redhat dot com
  2005-08-19 12:11 ` [Bug rtl-optimization/23478] [3.4 regression] " belyshev at depni dot sinp dot msu dot ru
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at redhat dot com @ 2005-08-19 11:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jakub at redhat dot com  2005-08-19 11:09 -------
Created an attachment (id=9546)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9546&action=view)
pr23478.C

Testcase.

-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
  2005-08-19 11:28 ` [Bug rtl-optimization/23478] " jakub at redhat dot com
@ 2005-08-19 12:11 ` belyshev at depni dot sinp dot msu dot ru
  2005-08-19 13:57 ` jakub at redhat dot com
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-08-19 12:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at depni dot sinp dot msu dot ru  2005-08-19 11:35 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-19 11:35:06
               date|                            |
            Summary|Miscompilation due to       |[3.4 regression]
                   |reloading of a var that is  |Miscompilation due to
                   |also used in EH pad         |reloading of a var that is
                   |                            |also used in EH pad
   Target Milestone|---                         |3.4.5


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
  2005-08-19 11:28 ` [Bug rtl-optimization/23478] " jakub at redhat dot com
  2005-08-19 12:11 ` [Bug rtl-optimization/23478] [3.4 regression] " belyshev at depni dot sinp dot msu dot ru
@ 2005-08-19 13:57 ` jakub at redhat dot com
  2005-08-19 18:33 ` rth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at redhat dot com @ 2005-08-19 13:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jakub at redhat dot com  2005-08-19 13:36 -------
caller-save.c inserts the restore insns after the can_throw_internal () CALL_INSN
and as the rest of reload excepts fixup_abnormal_edges to fix the mess up.
But, fixup_abnormal_edges only inserts the instructions on the fallthrough
edge, not on the fallthrough edge and the EH edge.
Is the bug in fixup_abnormal_edges then (which ought to insert the insns
on all the edges rather than just one) or is the bug in caller-save.c which
would need to take care of this and inserts the restore instructions not only
after the call insn (awaiting fixup_abnormal_edges moving it to next resp. new
bb), but also to the abnormal edge?
It doesn't seem reload.c nor reload1.c (except fixup_abnormal_edges) bothers with
this at all, so my guess would be that fixup_abnormal_edges needs to be changed,
on the other side it surprises me this didn't cause (reported) problems for
so long.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (2 preceding siblings ...)
  2005-08-19 13:57 ` jakub at redhat dot com
@ 2005-08-19 18:33 ` rth at gcc dot gnu dot org
  2005-08-19 18:37 ` rth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-08-19 18:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-08-19 18:32 -------
I think it's caller-save's bug.

The use of fixup_abnormal_edges in reload and reg-stack is to move output
reloads to the fallthru edge.  Well, the output reloads are not used on
the eh edge, because by definition the output was not generated.

-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (3 preceding siblings ...)
  2005-08-19 18:33 ` rth at gcc dot gnu dot org
@ 2005-08-19 18:37 ` rth at gcc dot gnu dot org
  2005-08-19 18:54 ` jakub at redhat dot com
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-08-19 18:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-08-19 18:34 -------
More, since you cannot insert insns on the abnormal EH edge, the fix to 
caller-save needs to be of the form "don't caller-save this variable".

-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (4 preceding siblings ...)
  2005-08-19 18:37 ` rth at gcc dot gnu dot org
@ 2005-08-19 18:54 ` jakub at redhat dot com
  2005-08-19 19:16 ` rth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at redhat dot com @ 2005-08-19 18:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jakub at redhat dot com  2005-08-19 18:51 -------
It can't be inserted just on abnormal critical edges:
gcc_assert (!((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e)));
So I guess we could insert it on the EH edges if !EDGE_CRITICAL_P and only
only avoid caller-saving it if EDGE_CRITICAL_P.

-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (5 preceding siblings ...)
  2005-08-19 18:54 ` jakub at redhat dot com
@ 2005-08-19 19:16 ` rth at gcc dot gnu dot org
  2005-08-22 17:33 ` cvs-commit at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-08-19 19:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-08-19 19:14 -------
Maybe.  I think you'll find that most of the time these edges *are* critical.
I don't think it's worth bothering to make the distinction.

-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (6 preceding siblings ...)
  2005-08-19 19:16 ` rth at gcc dot gnu dot org
@ 2005-08-22 17:33 ` cvs-commit at gcc dot gnu dot org
  2005-08-26 16:58 ` schwab at suse dot de
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-08-22 17:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-08-22 16:59 -------
Subject: Bug 23478

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-08-22 16:58:50

Modified files:
	gcc            : ChangeLog flow.c global.c regs.h 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: pr23478.C 

Log message:
	PR rtl-optimization/23478
	* regs.h (reg_info): Add throw_calls_crossed.
	(REG_N_THROWING_CALLS_CROSSED): Define.
	* flow.c (allocate_reg_life_data): Initialize
	REG_N_THROWING_CALLS_CROSSED.
	(propagate_one_insn, attempt_auto_inc): Update
	REG_N_THROWING_CALLS_CROSSED.
	* global.c (global_alloc): Don't allocate pseudos across
	calls that may throw.
	
	* g++.dg/opt/pr23478.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9799&r2=2.9800
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&r1=1.634&r2=1.635
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/global.c.diff?cvsroot=gcc&r1=1.130&r2=1.131
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regs.h.diff?cvsroot=gcc&r1=1.39&r2=1.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5949&r2=1.5950
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr23478.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (7 preceding siblings ...)
  2005-08-22 17:33 ` cvs-commit at gcc dot gnu dot org
@ 2005-08-26 16:58 ` schwab at suse dot de
  2005-08-29 23:00 ` sje at cup dot hp dot com
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: schwab at suse dot de @ 2005-08-26 16:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |23579


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (8 preceding siblings ...)
  2005-08-26 16:58 ` schwab at suse dot de
@ 2005-08-29 23:00 ` sje at cup dot hp dot com
  2005-09-01  5:29 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: sje at cup dot hp dot com @ 2005-08-29 23:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sje at cup dot hp dot com  2005-08-29 22:51 -------
The patch for this bug appears to be triggering PR 23548.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (9 preceding siblings ...)
  2005-08-29 23:00 ` sje at cup dot hp dot com
@ 2005-09-01  5:29 ` cvs-commit at gcc dot gnu dot org
  2005-09-01  6:05 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-01  5:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-01 05:29 -------
Subject: Bug 23478

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-09-01 05:29:04

Modified files:
	gcc            : ChangeLog global.c local-alloc.c 

Log message:
	PR rtl-optimization/23478
	* local-alloc.c (struct qty): Add n_throwing_calls_crossed field.
	(alloc_qty): Initialize it.
	(update_equiv_regs): Clear REG_N_THROWING_CALLS_CROSSED.
	(combine_regs): Combine also n_throwing_calls_crossed fields.
	(find_free_reg): Don't attempt to caller-save pseudos crossing
	calls that might throw.
	* global.c (struct allocno): Add throwing_calls_crossed field.
	(global_alloc): Revert 2005-08-22 change.  Initialize
	throwing_calls_crossed.
	(find_reg): Don't attempt to caller-save pseudos crossing calls that
	might throw.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9871&r2=2.9872
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/global.c.diff?cvsroot=gcc&r1=1.131&r2=1.132
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/local-alloc.c.diff?cvsroot=gcc&r1=1.153&r2=1.154



-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (10 preceding siblings ...)
  2005-09-01  5:29 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-01  6:05 ` cvs-commit at gcc dot gnu dot org
  2005-09-01 20:51 ` cvs-commit at gcc dot gnu dot org
  2005-09-01 20:53 ` jakub at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-01  6:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-01 06:05 -------
Subject: Bug 23478

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	jakub@gcc.gnu.org	2005-09-01 06:05:00

Modified files:
	gcc            : ChangeLog regs.h global.c flow.c local-alloc.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: pr23478.C 

Log message:
	PR rtl-optimization/23478
	* regs.h (reg_info): Add throw_calls_crossed.
	(REG_N_THROWING_CALLS_CROSSED): Define.
	* flow.c (allocate_reg_life_data): Initialize
	REG_N_THROWING_CALLS_CROSSED.
	(propagate_one_insn, attempt_auto_inc): Update
	REG_N_THROWING_CALLS_CROSSED.
	* local-alloc.c (struct qty): Add n_throwing_calls_crossed field.
	(alloc_qty): Initialize it.
	(update_equiv_regs): Clear REG_N_THROWING_CALLS_CROSSED.
	(combine_regs): Combine also n_throwing_calls_crossed fields.
	(find_free_reg): Don't attempt to caller-save pseudos crossing
	calls that might throw.
	* global.c (struct allocno): Add throwing_calls_crossed field.
	(global_alloc): Initialize throwing_calls_crossed.
	(find_reg): Don't attempt to caller-save pseudos crossing calls that
	might throw.
	
	* g++.dg/opt/pr23478.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.403&r2=2.7592.2.404
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regs.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.38&r2=1.38.12.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/global.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.123&r2=1.123.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.620&r2=1.620.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/local-alloc.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.144&r2=1.144.10.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.364&r2=1.5084.2.365
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr23478.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (11 preceding siblings ...)
  2005-09-01  6:05 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-01 20:51 ` cvs-commit at gcc dot gnu dot org
  2005-09-01 20:53 ` jakub at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-01 20:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-01 20:51 -------
Subject: Bug 23478

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	jakub@gcc.gnu.org	2005-09-01 20:51:09

Modified files:
	gcc            : ChangeLog regs.h local-alloc.c flow.c global.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/opt: pr23478.C 

Log message:
	PR rtl-optimization/23478
	* regs.h (reg_info): Add throw_calls_crossed.
	(REG_N_THROWING_CALLS_CROSSED): Define.
	* flow.c (allocate_reg_life_data): Initialize
	REG_N_THROWING_CALLS_CROSSED.
	(propagate_one_insn, attempt_auto_inc): Update
	REG_N_THROWING_CALLS_CROSSED.
	* local-alloc.c (struct qty): Add n_throwing_calls_crossed field.
	(alloc_qty): Initialize it.
	(update_equiv_regs): Clear REG_N_THROWING_CALLS_CROSSED.
	(combine_regs): Combine also n_throwing_calls_crossed fields.
	(find_free_reg): Don't attempt to caller-save pseudos crossing
	calls that might throw.
	* global.c (struct allocno): Add throwing_calls_crossed field.
	(global_alloc): Initialize throwing_calls_crossed.
	(find_reg): Don't attempt to caller-save pseudos crossing calls that
	might throw.
	
	* g++.dg/opt/pr23478.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.912&r2=2.2326.2.913
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regs.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.31.4.1&r2=1.31.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/local-alloc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.126.4.1&r2=1.126.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.572.4.4&r2=1.572.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/global.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.98&r2=1.98.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.426&r2=1.3389.2.427
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/pr23478.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1



-- 


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug rtl-optimization/23478] [3.4 regression] Miscompilation due to reloading of a var that is also used in EH pad
  2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
                   ` (12 preceding siblings ...)
  2005-09-01 20:51 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-01 20:53 ` jakub at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-09-01 20:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jakub at gcc dot gnu dot org  2005-09-01 20:52 -------
Should be fixed on 3.4/4.0/HEAD.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-09-01 20:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-19 11:09 [Bug rtl-optimization/23478] New: Miscompilation due to reloading of a var that is also used in EH pad jakub at redhat dot com
2005-08-19 11:28 ` [Bug rtl-optimization/23478] " jakub at redhat dot com
2005-08-19 12:11 ` [Bug rtl-optimization/23478] [3.4 regression] " belyshev at depni dot sinp dot msu dot ru
2005-08-19 13:57 ` jakub at redhat dot com
2005-08-19 18:33 ` rth at gcc dot gnu dot org
2005-08-19 18:37 ` rth at gcc dot gnu dot org
2005-08-19 18:54 ` jakub at redhat dot com
2005-08-19 19:16 ` rth at gcc dot gnu dot org
2005-08-22 17:33 ` cvs-commit at gcc dot gnu dot org
2005-08-26 16:58 ` schwab at suse dot de
2005-08-29 23:00 ` sje at cup dot hp dot com
2005-09-01  5:29 ` cvs-commit at gcc dot gnu dot org
2005-09-01  6:05 ` cvs-commit at gcc dot gnu dot org
2005-09-01 20:51 ` cvs-commit at gcc dot gnu dot org
2005-09-01 20:53 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).