public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/21299] [3.4/4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
@ 2006-03-06  2:26 ` pinskia at gcc dot gnu dot org
  2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-06  2:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-06 02:26 -------
Confirmed, this did not ICE in 2.95.3.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |3.0.4 4.0.0 4.1.0 4.2.0
      Known to work|                            |2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-06 02:26:45
               date|                            |
            Summary|internal error on invalid   |[3.4/4.0/4.1/4.2 Regression]
                   |asm statement               |internal error on invalid
                   |                            |asm statement
   Target Milestone|---                         |4.0.3


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


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

* [Bug rtl-optimization/21299] [3.4/4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
  2006-03-06  2:26 ` [Bug rtl-optimization/21299] [3.4/4.0/4.1/4.2 Regression] internal error on invalid asm statement pinskia at gcc dot gnu dot org
@ 2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
  2006-07-27 17:04 ` [Bug rtl-optimization/21299] [4.0/4.1/4.2 " tbm at cyrius dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:20 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.0.4


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
  2006-03-06  2:26 ` [Bug rtl-optimization/21299] [3.4/4.0/4.1/4.2 Regression] internal error on invalid asm statement pinskia at gcc dot gnu dot org
  2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
@ 2006-07-27 17:04 ` tbm at cyrius dot com
  2006-07-27 17:16 ` tbm at cyrius dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2006-07-27 17:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tbm at cyrius dot com  2006-07-27 17:04 -------
This is not i386 specific.  I get the same on ia64 with e.g.

void f(int port)
{
    __asm__ volatile ("inb %1,%0"
        :"=a" (port)
        :"d"((unsigned short) port));
}

It's still there as of current gcc 4.2.


-- 

tbm at cyrius dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tbm at cyrius dot com


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-07-27 17:04 ` [Bug rtl-optimization/21299] [4.0/4.1/4.2 " tbm at cyrius dot com
@ 2006-07-27 17:16 ` tbm at cyrius dot com
  2006-07-27 17:17 ` tbm at cyrius dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2006-07-27 17:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tbm at cyrius dot com  2006-07-27 17:16 -------
(In reply to comment #2)
> This is not i386 specific.  I get the same on ia64 with e.g.
> 
> void f(int port)
> {
>     __asm__ volatile ("inb %1,%0"
>         :"=a" (port)
>         :"d"((unsigned short) port));
> }

Just for the record, here's the output:

tbm@coconut0:~/src/svgalib-1.4.3$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 x.c
x.c: In function 'f':
x.c:3: error: impossible register constraint in 'asm'
x.c:3: error: impossible register constraint in 'asm'
x.c:3: error: impossible register constraint in 'asm'
x.c:6: error: unrecognizable insn:
(insn 11 7 23 2 (set (reg:SI 2 r2)
        (asm_operands/v:SI ("inb %1,%0") ("=a") 0 [
                (reg:HI 112 in0)
            ]
             [
                (asm_input:HI ("d"))
            ] ("x.c") 3)) -1 (nil)
    (nil))
x.c:6: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:393
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


-- 


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-07-27 17:16 ` tbm at cyrius dot com
@ 2006-07-27 17:17 ` tbm at cyrius dot com
  2006-08-07  9:09 ` hubicka at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2006-07-27 17:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tbm at cyrius dot com  2006-07-27 17:17 -------
FWIW, it works (i.e. error, but no ICE) on mipsel, x86_64 and powerpc.


-- 


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-07-27 17:17 ` tbm at cyrius dot com
@ 2006-08-07  9:09 ` hubicka at gcc dot gnu dot org
  2006-08-08 13:20 ` patchapp at dberlin dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2006-08-07  9:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hubicka at gcc dot gnu dot org  2006-08-07 09:09 -------
The IA-64 problem shall be fixed by my patch for PR target/26655.
The x86 problem is trickier.  Reload is decided to merge all classes mentioned
in given alternative, so "ad" is equivalent to "A", while recog.c is working
the oposite way.  
The best way to fix it I can think of is to make reload ignore the classes that
are too small to fit the register themselves.  It does not fix the problem
quite in general but at least deals with the x86 cases.

(in general one can have multiple register mode, join together two multiple reg
classes but reload might place the result just on the boundary still making
recog unhappy.)


Better ideas?

Honza

Index: reload.c
===================================================================
-cp -L reload.c (revision 115987) -L reload.c   (working copy)
.svn/text-base/reload.c.svn-base reload.c
*** reload.c    (revision 115987)
--- reload.c    (working copy)
*************** find_reloads (rtx insn, int replace, int
*** 2913,2918 ****
--- 2913,2919 ----
             operand.  */
          int constmemok = 0;
          int earlyclobber = 0;
+         enum reg_class class = NO_REGS;

          /* If the predicate accepts a unary operator, it means that
             we need to reload the operand, but do not do this for
*************** find_reloads (rtx insn, int replace, int
*** 3309,3314 ****
--- 3310,3316 ----
                /* Drop through into 'r' case.  */

              case 'r':
+               class = GENERAL_REGS;
                this_alternative[i]
                  = (int) reg_class_subunion[this_alternative[i]][(int)
GENERAL_REGS];
                goto reg;
*************** find_reloads (rtx insn, int replace, int
*** 3368,3384 ****
                    break;
                  }

                this_alternative[i]
                  = (int) (reg_class_subunion
                           [this_alternative[i]]
!                          [(int) REG_CLASS_FROM_CONSTRAINT (c, p)]);
              reg:
                if (GET_MODE (operand) == BLKmode)
                  break;
                winreg = 1;
                if (REG_P (operand)
!                   && reg_fits_class_p (operand, this_alternative[i],
!                                        offset, GET_MODE
(recog_data.operand[i])))
                  win = 1;
                break;
              }
--- 3370,3409 ----
                    break;
                  }

+               class = REG_CLASS_FROM_CONSTRAINT (c, p);
+               /* When class is too tiny to hold the operand, ignore it.
+                  See PR21299.  First quickly test if things looks slopy
+                  and if they does try to look if register is really
+                  available.  */
+               if (CLASS_MAX_NREGS (class, GET_MODE (recog_data.operand[i]))
+                   > (int)reg_class_size [class])
+                 {
+                   int regno;
+                   enum machine_mode mode;
+                   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+                     if (TEST_HARD_REG_BIT (reg_class_contents[class], regno)
+                         && HARD_REGNO_MODE_OK (regno, mode)
+                         && (regno + hard_regno_nregs[regno][mode]
+                             < FIRST_PSEUDO_REGISTER)
+                         && TEST_HARD_REG_BIT
+                                (reg_class_contents[class],
+                                 regno + hard_regno_nregs[regno][mode]))
+                    break;
+                  if (regno == FIRST_PSEUDO_REGISTER)
+                    break;
+                 }
                this_alternative[i]
                  = (int) (reg_class_subunion
                           [this_alternative[i]]
!                          [(int) class]);
              reg:
                if (GET_MODE (operand) == BLKmode)
                  break;
                winreg = 1;
                if (REG_P (operand)
!                   && reg_fits_class_p (operand, class,
!                                        offset,
!                                        GET_MODE (recog_data.operand[i])))
                  win = 1;
                break;
              }


-- 


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-08-07  9:09 ` hubicka at gcc dot gnu dot org
@ 2006-08-08 13:20 ` patchapp at dberlin dot org
  2006-08-11  7:26 ` ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: patchapp at dberlin dot org @ 2006-08-08 13:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from patchapp at dberlin dot org  2006-08-08 13:20 -------
Subject: Bug number PR target/21299

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00204.html


-- 


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2006-08-08 13:20 ` patchapp at dberlin dot org
@ 2006-08-11  7:26 ` ebotcazou at gcc dot gnu dot org
  2006-09-17  9:54 ` steven at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2006-08-11  7:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ebotcazou at gcc dot gnu dot org  2006-08-11 07:26 -------
Jan posted a patch 3 days ago.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |hubicka at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2006-08-11  7:26 ` ebotcazou at gcc dot gnu dot org
@ 2006-09-17  9:54 ` steven at gcc dot gnu dot org
  2006-09-19 21:22 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-09-17  9:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from steven at gcc dot gnu dot org  2006-09-17 09:54 -------
Created an attachment (id=12286)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12286&action=view)
patch implementing what Ian suggested

See http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00271.html


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|hubicka at gcc dot gnu dot  |steven at gcc dot gnu dot
                   |org                         |org


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


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

* [Bug rtl-optimization/21299] [4.0/4.1/4.2 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2006-09-17  9:54 ` steven at gcc dot gnu dot org
@ 2006-09-19 21:22 ` steven at gcc dot gnu dot org
  2006-09-19 21:23 ` [Bug rtl-optimization/21299] [4.0/4.1 " steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-09-19 21:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from steven at gcc dot gnu dot org  2006-09-19 21:22 -------
Subject: Bug 21299

Author: steven
Date: Tue Sep 19 21:22:31 2006
New Revision: 117061

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117061
Log:
        PR rtl-optimization/21299
        * reload1.c (reload): Purge invalid ASMs in the final pass.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/reload1.c


-- 


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


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

* [Bug rtl-optimization/21299] [4.0/4.1 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2006-09-19 21:22 ` steven at gcc dot gnu dot org
@ 2006-09-19 21:23 ` steven at gcc dot gnu dot org
  2007-01-18  3:54 ` gdr at gcc dot gnu dot org
  2007-03-19 15:27 ` jakub at gcc dot gnu dot org
  12 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-09-19 21:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from steven at gcc dot gnu dot org  2006-09-19 21:23 -------
Fixed on trunk for GCC 4.2.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|steven at gcc dot gnu dot   |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW
      Known to fail|3.0.4 4.0.0 4.1.0 4.2.0     |3.0.4 4.0.0 4.1.0
      Known to work|2.95.3                      |2.95.3 4.2.0
            Summary|[4.0/4.1/4.2 Regression]    |[4.0/4.1 Regression]
                   |internal error on invalid   |internal error on invalid
                   |asm statement               |asm statement


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


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

* [Bug rtl-optimization/21299] [4.0/4.1 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2006-09-19 21:23 ` [Bug rtl-optimization/21299] [4.0/4.1 " steven at gcc dot gnu dot org
@ 2007-01-18  3:54 ` gdr at gcc dot gnu dot org
  2007-03-19 15:27 ` jakub at gcc dot gnu dot org
  12 siblings, 0 replies; 13+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-01-18  3:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from gdr at gcc dot gnu dot org  2007-01-18 03:54 -------
Fixed in GCC-4.2.0.
Won't fix for GCC-4.0.x


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.2.0


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


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

* [Bug rtl-optimization/21299] [4.0/4.1 Regression] internal error on invalid asm statement
       [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2007-01-18  3:54 ` gdr at gcc dot gnu dot org
@ 2007-03-19 15:27 ` jakub at gcc dot gnu dot org
  12 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-03-19 15:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jakub at gcc dot gnu dot org  2007-03-19 15:27 -------
This fix causes PR30505 regression.


-- 


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


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

end of thread, other threads:[~2007-03-19 15:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21299-1600@http.gcc.gnu.org/bugzilla/>
2006-03-06  2:26 ` [Bug rtl-optimization/21299] [3.4/4.0/4.1/4.2 Regression] internal error on invalid asm statement pinskia at gcc dot gnu dot org
2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
2006-07-27 17:04 ` [Bug rtl-optimization/21299] [4.0/4.1/4.2 " tbm at cyrius dot com
2006-07-27 17:16 ` tbm at cyrius dot com
2006-07-27 17:17 ` tbm at cyrius dot com
2006-08-07  9:09 ` hubicka at gcc dot gnu dot org
2006-08-08 13:20 ` patchapp at dberlin dot org
2006-08-11  7:26 ` ebotcazou at gcc dot gnu dot org
2006-09-17  9:54 ` steven at gcc dot gnu dot org
2006-09-19 21:22 ` steven at gcc dot gnu dot org
2006-09-19 21:23 ` [Bug rtl-optimization/21299] [4.0/4.1 " steven at gcc dot gnu dot org
2007-01-18  3:54 ` gdr at gcc dot gnu dot org
2007-03-19 15:27 ` 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).