public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43897]  New: IA-64 asm clobbers are ignored
@ 2010-04-26 16:03 wilson at gcc dot gnu dot org
  2010-04-26 17:15 ` [Bug target/43897] " steven at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wilson at gcc dot gnu dot org @ 2010-04-26 16:03 UTC (permalink / raw)
  To: gcc-bugs

I noticed this while looking at dependency violations that occur during a gcc
bootstrap.  We get two in the libgcc build, both are due to the same problem. 
Here is a testcase extracted from libgcc/soft-float/fixunstfti.c.
int
sub (int i)
{
  float tmp;
  if (i)
    __asm__ __volatile__ ("frcpa.s0 %0,p1=f0,f0"                        \
                          : "=f" (tmp) : : "p1" );                      \
  return i + 10;
}
Compiling this with -O2 gives a DV error because there is a missing stop bit
after the asm.  The assembler code has
#APP
// 6 "tmp.c" 1                                                                  
        frcpa.s0 f6,p1=f0,f0
// 0 "" 2                                                                       
#NO_APP
.L2:
        .mib
        adds r8 = 10, r32
        mov pr = r2, -1
        br.ret.sptk.many b0

The problem is in rtx_needs_barrier in config/ia64/ia64.c, which has
    case CLOBBER:
    case USE:
      /* Clobber & use are for earlier compiler-phases only.  */
      break;
I think this was written in the olden days when we still had reg-no-conflict
blocks and libcall blocks and other stuff that would insert naked clobbers into
the rtl stream.  These should be ignored, but I don't think that they will
occur anymore.  However, it isn't safe to ignore a clobber inside a parallel,
particularly when that parallel is for an extended asm.  This is a serious
problem that needs to be fixed.

The problem can be worked around by using -mvolatile-asm-stop, but this
obviously only works for volatile asms.


-- 
           Summary: IA-64 asm clobbers are ignored
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wilson at gcc dot gnu dot org
GCC target triplet: ia64-*


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


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

* [Bug target/43897] IA-64 asm clobbers are ignored
  2010-04-26 16:03 [Bug target/43897] New: IA-64 asm clobbers are ignored wilson at gcc dot gnu dot org
@ 2010-04-26 17:15 ` steven at gcc dot gnu dot org
  2010-04-26 17:21 ` [Bug target/43897] [4.4/4.5 Regression] " steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-04-26 17:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-26 17:15:13
               date|                            |


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


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

* [Bug target/43897] [4.4/4.5 Regression] IA-64 asm clobbers are ignored
  2010-04-26 16:03 [Bug target/43897] New: IA-64 asm clobbers are ignored wilson at gcc dot gnu dot org
  2010-04-26 17:15 ` [Bug target/43897] " steven at gcc dot gnu dot org
@ 2010-04-26 17:21 ` steven at gcc dot gnu dot org
  2010-04-26 21:41 ` [Bug target/43897] [4.4/4.5/4.6 " wilson at gcc dot gnu dot org
  2010-05-19 12:53 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-04-26 17:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from steven at gcc dot gnu dot org  2010-04-26 17:21 -------
Regression from GCC 4.3, which still had libcall notes.

--- t.s.434     2010-04-26 10:21:18.000000000 -0700
+++ t.s.442     2010-04-26 10:21:36.000000000 -0700
@@ -2,6 +2,7 @@
        .pred.safe_across_calls p1-p5,p16-p63
        .text
        .align 16
+       .align 64
        .global sub#
        .type   sub#, @function
        .proc sub#
@@ -12,22 +13,22 @@
        .save pr, r2
        mov r2 = pr
        .body
-       nop 0
-       .mmb
        cmp4.eq p6, p7 = 0, r32
+       .mmb
+       nop 0
        nop 0
        (p6) br.cond.dpnt .L2
+       ;;
 #APP
 // 6 "t.c" 1
        frcpa.s0 f6,p1=f0,f0
 // 0 "" 2
 #NO_APP
-       ;;
 .L2:
        .mib
        adds r8 = 10, r32
        mov pr = r2, -1
        br.ret.sptk.many b0
        .endp sub#
-       .ident  "GCC: (Debian 4.3.4-6) 4.3.4"
+       .ident  "GCC: (Debian 4.4.2-9) 4.4.3 20100108 (prerelease)"
        .section        .note.GNU-stack,"",@progbits


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|IA-64 asm clobbers are      |[4.4/4.5 Regression] IA-64
                   |ignored                     |asm clobbers are ignored
   Target Milestone|---                         |4.4.5


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


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

* [Bug target/43897] [4.4/4.5/4.6 Regression] IA-64 asm clobbers are ignored
  2010-04-26 16:03 [Bug target/43897] New: IA-64 asm clobbers are ignored wilson at gcc dot gnu dot org
  2010-04-26 17:15 ` [Bug target/43897] " steven at gcc dot gnu dot org
  2010-04-26 17:21 ` [Bug target/43897] [4.4/4.5 Regression] " steven at gcc dot gnu dot org
@ 2010-04-26 21:41 ` wilson at gcc dot gnu dot org
  2010-05-19 12:53 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: wilson at gcc dot gnu dot org @ 2010-04-26 21:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from wilson at gcc dot gnu dot org  2010-04-26 21:40 -------
GCC-4.3 is still broken; my testcase just doesn't happen to fail there.  I
suspect this is broken all of the way back to gcc-2.95.  This does point to
where the problem was exposed though.  It is the
-msched-stop-bits-after-every-cycle patch, which emits stop bits when we hit
hardware resource limits.  I get accidentally correct code on mainline if I use
-mno-sched-stop-bits-after-every-cycle.  This patch was added in between
gcc-4.3 and gcc-4.4.


-- 


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


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

* [Bug target/43897] [4.4/4.5/4.6 Regression] IA-64 asm clobbers are ignored
  2010-04-26 16:03 [Bug target/43897] New: IA-64 asm clobbers are ignored wilson at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-04-26 21:41 ` [Bug target/43897] [4.4/4.5/4.6 " wilson at gcc dot gnu dot org
@ 2010-05-19 12:53 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-19 12:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

end of thread, other threads:[~2010-05-19 12:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26 16:03 [Bug target/43897] New: IA-64 asm clobbers are ignored wilson at gcc dot gnu dot org
2010-04-26 17:15 ` [Bug target/43897] " steven at gcc dot gnu dot org
2010-04-26 17:21 ` [Bug target/43897] [4.4/4.5 Regression] " steven at gcc dot gnu dot org
2010-04-26 21:41 ` [Bug target/43897] [4.4/4.5/4.6 " wilson at gcc dot gnu dot org
2010-05-19 12:53 ` rguenth 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).