public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc
@ 2003-11-24  3:27 amodra at gcc dot gnu dot org
  2003-11-24  3:29 ` [Bug optimization/13169] " amodra at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: amodra at gcc dot gnu dot org @ 2003-11-24  3:27 UTC (permalink / raw)
  To: gcc-bugs

This testcase demonstrates a problem with global_alloc of registers
   that are mentioned as a "from" register in ELIMINATE_REGS.
   When compiled with -O0 -fomit-frame-pointer, this testcase returns a
   zero status.  When compiled with -O1 or higher, it returns 1.

   Notes: rs6000.h mentions both r31 and r30 as a "from" register in
   ELIMINATE_REGS.

   global.c:global_alloc does

  for (i = 0; i < ARRAY_SIZE (eliminables); i++)
    {
      SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from);

      if (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to)
	  || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp))
	SET_HARD_REG_BIT (no_global_alloc_regs, eliminables[i].from);
    }

   resulting in both r30 and r31 being set in eliminable_regset,
   and *not* in no_global_alloc_regs.  Later we have

      /* Eliminate conflicts between pseudos and eliminable registers.  If
	 the register is not eliminated, the pseudo won't really be able to
	 live in the eliminable register, so the conflict doesn't matter.
	 If we do eliminate the register, the conflict will no longer exist.
	 So in either case, we can ignore the conflict.  Likewise for
	 preferences.  */

      for (i = 0; i < (size_t) max_allocno; i++)
	{
	  AND_COMPL_HARD_REG_SET (allocno[i].hard_reg_conflicts,
				  eliminable_regset);
	  AND_COMPL_HARD_REG_SET (allocno[i].hard_reg_copy_preferences,
				  eliminable_regset);
	  AND_COMPL_HARD_REG_SET (allocno[i].hard_reg_preferences,
				  eliminable_regset);
	}

    Removing r30 and r31 from hard_reg_conflicts allows them to be used
    willy nilly as global regs, when really they should remain as
    conflicts because they're used by the asm.  :-(

-- 
           Summary: asm using r30 or r31 confuses global_alloc
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amodra at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
@ 2003-11-24  3:29 ` amodra at gcc dot gnu dot org
  2003-11-24 15:20 ` amodra at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gcc dot gnu dot org @ 2003-11-24  3:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at gcc dot gnu dot org  2003-11-24 03:29 -------
Created an attachment (id=5197)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5197&action=view)
testcase


-- 


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
  2003-11-24  3:29 ` [Bug optimization/13169] " amodra at gcc dot gnu dot org
@ 2003-11-24 15:20 ` amodra at gcc dot gnu dot org
  2003-11-24 15:22 ` amodra at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gcc dot gnu dot org @ 2003-11-24 15:20 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |amodra at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
  2003-11-24  3:29 ` [Bug optimization/13169] " amodra at gcc dot gnu dot org
  2003-11-24 15:20 ` amodra at gcc dot gnu dot org
@ 2003-11-24 15:22 ` amodra at gcc dot gnu dot org
  2003-11-24 15:24 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gcc dot gnu dot org @ 2003-11-24 15:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at gcc dot gnu dot org  2003-11-24 15:22 -------
Proposed fix http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01924.html


-- 


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-11-24 15:22 ` amodra at gcc dot gnu dot org
@ 2003-11-24 15:24 ` pinskia at gcc dot gnu dot org
  2003-12-06 12:22 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-24 15:24 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
   Target Milestone|---                         |3.4


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-11-24 15:24 ` pinskia at gcc dot gnu dot org
@ 2003-12-06 12:22 ` cvs-commit at gcc dot gnu dot org
  2003-12-06 12:30 ` amodra at gcc dot gnu dot org
  2004-01-31 12:46 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-06 12:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-06 12:22 -------
Subject: Bug 13169

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amodra@gcc.gnu.org	2003-12-06 12:22:31

Modified files:
	gcc            : ChangeLog basic-block.h final.c flow.c global.c 
	                 regs.h 

Log message:
	PR 13169
	* basic-block.h (PROP_ASM_SCAN): Define.
	* final.c (regs_asm_clobbered): New array.
	* regs.h (regs_asm_clobbered): Declare.
	* flow.c (life_analysis): Init it.
	(mark_set_regs): Set PROP_ASM_SCAN for asms.
	(mark_set_1): Set regs_asm_clobbered.
	* global.c (global_alloc): Don't set eliminable_regset when
	regs_asm_clobbered.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1938&r2=2.1939
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/basic-block.h.diff?cvsroot=gcc&r1=1.183&r2=1.184
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&r1=1.297&r2=1.298
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&r1=1.566&r2=1.567
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/global.c.diff?cvsroot=gcc&r1=1.94&r2=1.95
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regs.h.diff?cvsroot=gcc&r1=1.30&r2=1.31



-- 


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2003-12-06 12:22 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-06 12:30 ` amodra at gcc dot gnu dot org
  2004-01-31 12:46 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at gcc dot gnu dot org @ 2003-12-06 12:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From amodra at gcc dot gnu dot org  2003-12-06 12:30 -------
Fixed for gcc-3.4

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


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


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

* [Bug optimization/13169] asm using r30 or r31 confuses global_alloc
  2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2003-12-06 12:30 ` amodra at gcc dot gnu dot org
@ 2004-01-31 12:46 ` cvs-commit at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-31 12:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-31 12:46 -------
Subject: Bug 13169

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	amodra@gcc.gnu.org	2004-01-31 12:46:04

Modified files:
	gcc            : ChangeLog.hammer basic-block.h regs.h final.c 
	                 flow.c global.c 

Log message:
	Backport from mainline.
	2003-12-19  James E Wilson  <wilson@specifixinc.com>
	* flow.c (mark_set_regs, case PARALLEL): Scan loop forwards.
	Add case for ASM_OPERANDS.
	* global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered
	registers.
	
	2003-12-06  Alan Modra  <amodra@bigpond.net.au>
	PR 13169
	* basic-block.h (PROP_ASM_SCAN): Define.
	* final.c (regs_asm_clobbered): New array.
	* regs.h (regs_asm_clobbered): Declare.
	* flow.c (life_analysis): Init it.
	(mark_set_regs): Set PROP_ASM_SCAN for asms.
	(mark_set_1): Set regs_asm_clobbered.
	* global.c (global_alloc): Don't set eliminable_regset when
	regs_asm_clobbered.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.301&r2=1.1.2.302
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/basic-block.h.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.161.2.11&r2=1.161.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/regs.h.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.26.2.1&r2=1.26.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.270.2.7&r2=1.270.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/flow.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.540.2.8&r2=1.540.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/global.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.86.2.2&r2=1.86.2.3



-- 


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


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

end of thread, other threads:[~2004-01-31 12:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-24  3:27 [Bug optimization/13169] New: asm using r30 or r31 confuses global_alloc amodra at gcc dot gnu dot org
2003-11-24  3:29 ` [Bug optimization/13169] " amodra at gcc dot gnu dot org
2003-11-24 15:20 ` amodra at gcc dot gnu dot org
2003-11-24 15:22 ` amodra at gcc dot gnu dot org
2003-11-24 15:24 ` pinskia at gcc dot gnu dot org
2003-12-06 12:22 ` cvs-commit at gcc dot gnu dot org
2003-12-06 12:30 ` amodra at gcc dot gnu dot org
2004-01-31 12:46 ` cvs-commit 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).