public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720
@ 2021-10-15  2:57 cnsun at uwaterloo dot ca
  2021-10-15  3:21 ` [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-10-15  2:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

            Bug ID: 102761
           Summary: ICE with -O1 and above: in
                    ix86_print_operand_address_as, at
                    config/i386/i386.c:13720
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211014 (experimental) [master -gee9fa8a57] (GCC)

$ cat mutant.c
f() { asm("%a0" : : "X"(tag() ? 2 : 1)); }

$ gcc-trunk -w -O1 mutant.c
during RTL pass: final
mutant.c: In function ‘f’:
mutant.c:1:42: internal compiler error: in ix86_print_operand_address_as, at
config/i386/i386.c:13720
    1 | f() { asm("%a0" : : "X"(tag() ? 2 : 1)); }
      |                                          ^
0x83f47a ix86_print_operand_address_as
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/config/i386/i386.c:13720
0xbe46e7 output_address(machine_mode, rtx_def*)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:3693
0xbe532e output_asm_insn(char const*, rtx_def**)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:3550
0xbe7612 final_scan_insn_1
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:2690
0xbe789f final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:2940
0xbe7b67 final_1
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:1997
0xbe8598 rest_of_handle_final
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:4285
0xbe8598 execute
        /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/gcc/final.c:4363
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
@ 2021-10-15  3:21 ` pinskia at gcc dot gnu.org
  2021-10-15  7:37 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-15  3:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|                            |2021-10-15
             Status|UNCONFIRMED                 |NEW
            Summary|ICE with -O1 and above: in  |[10/11/12 Regression] ICE
                   |ix86_print_operand_address_ |with -O1 and above: in
                   |as, at                      |ix86_print_operand_address_
                   |config/i386/i386.c:13720    |as due to %a0 and
                   |                            |if_then_else and X
                   |                            |constraint
      Known to work|                            |9.1.0, 9.4.0
   Target Milestone|---                         |10.4
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(insn 16 30 20 2 (parallel [
            (asm_operands/v ("%a0") ("") 0 [
                    (if_then_else:SI (ne:SI (reg:SI 0 ax [86])
                            (const_int 0 [0]))
                        (const_int 2 [0x2])
                        (const_int 1 [0x1]))
                ]
                 [
                    (asm_input:SI ("X") /app/example.cpp:1)
                ]
                 [] /app/example.cpp:1)
            (clobber (reg:CC 17 flags))
        ]) "/app/example.cpp":1:7 -1
     (expr_list:REG_DEAD (reg:SI 0 ax [86])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
  2021-10-15  3:21 ` [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint pinskia at gcc dot gnu.org
@ 2021-10-15  7:37 ` ubizjak at gmail dot com
  2021-10-18 15:04 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2021-10-15  7:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fb656094e9e..5d019f8e058 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -13921,7 +13921,10 @@ ix86_print_operand_address_as (FILE *file, rtx addr,
 static void
 ix86_print_operand_address (FILE *file, machine_mode /*mode*/, rtx addr)
 {
-  ix86_print_operand_address_as (file, addr, ADDR_SPACE_GENERIC, false);
+  if (this_is_asm_operands && ! address_operand (addr, VOIDmode))
+    output_operand_lossage ("invalid constraints for operand");
+  else
+    ix86_print_operand_address_as (file, addr, ADDR_SPACE_GENERIC, false);
 }

 /* Implementation of TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA.  */

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
  2021-10-15  3:21 ` [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint pinskia at gcc dot gnu.org
  2021-10-15  7:37 ` ubizjak at gmail dot com
@ 2021-10-18 15:04 ` cvs-commit at gcc dot gnu.org
  2021-10-18 21:01 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-18 15:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:4abc0c196b10251dc80d0743ba9e8ab3e56c61ed

commit r12-4484-g4abc0c196b10251dc80d0743ba9e8ab3e56c61ed
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Mon Oct 18 17:03:28 2021 +0200

    i386: Fix ICE in ix86_print_opreand_address [PR 102761]

    2021-10-18  Uroš Bizjak  <ubizjak@gmail.com>

            PR target/102761

    gcc/ChangeLog:

            * config/i386/i386.c (ix86_print_operand_address):
            Error out for non-address_operand asm operands.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr102761.c: New test.

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-10-18 15:04 ` cvs-commit at gcc dot gnu.org
@ 2021-10-18 21:01 ` cvs-commit at gcc dot gnu.org
  2021-10-27 19:27 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-18 21:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:e9c3a7243bf7a4db9b0dec44d278e9bf527f3d9b

commit r11-9171-ge9c3a7243bf7a4db9b0dec44d278e9bf527f3d9b
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Mon Oct 18 17:03:28 2021 +0200

    i386: Fix ICE in ix86_print_opreand_address [PR 102761]

    2021-10-18  Uroš Bizjak  <ubizjak@gmail.com>

            PR target/102761

    gcc/ChangeLog:

            * config/i386/i386.c (ix86_print_operand_address):
            Error out for non-address_operand asm operands.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr102761.c: New test.

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
                   ` (3 preceding siblings ...)
  2021-10-18 21:01 ` cvs-commit at gcc dot gnu.org
@ 2021-10-27 19:27 ` ubizjak at gmail dot com
  2021-10-27 19:29 ` cvs-commit at gcc dot gnu.org
  2021-10-27 19:30 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2021-10-27 19:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

Uroš Bizjak <ubizjak at gmail dot com> changed:

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

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
Not a regression, so let's not backport this too far.

Fixed for gcc-11.3+.

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
                   ` (4 preceding siblings ...)
  2021-10-27 19:27 ` ubizjak at gmail dot com
@ 2021-10-27 19:29 ` cvs-commit at gcc dot gnu.org
  2021-10-27 19:30 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-27 19:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:9644864791547f8ecca23f23a8c6a64cfa79905c

commit r10-10239-g9644864791547f8ecca23f23a8c6a64cfa79905c
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Mon Oct 18 17:03:28 2021 +0200

    i386: Fix ICE in ix86_print_opreand_address [PR 102761]

    2021-10-18  Uroš Bizjak  <ubizjak@gmail.com>

            PR target/102761

    gcc/ChangeLog:

            * config/i386/i386.c (ix86_print_operand_address):
            Error out for non-address_operand asm operands.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr102761.c: New test.

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

* [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint
  2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
                   ` (5 preceding siblings ...)
  2021-10-27 19:29 ` cvs-commit at gcc dot gnu.org
@ 2021-10-27 19:30 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2021-10-27 19:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102761

--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #5)
> Not a regression, so let's not backport this too far.
> 
> Fixed for gcc-11.3+.

Actually, gcc-10.4+.

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

end of thread, other threads:[~2021-10-27 19:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  2:57 [Bug c/102761] New: ICE with -O1 and above: in ix86_print_operand_address_as, at config/i386/i386.c:13720 cnsun at uwaterloo dot ca
2021-10-15  3:21 ` [Bug target/102761] [10/11/12 Regression] ICE with -O1 and above: in ix86_print_operand_address_as due to %a0 and if_then_else and X constraint pinskia at gcc dot gnu.org
2021-10-15  7:37 ` ubizjak at gmail dot com
2021-10-18 15:04 ` cvs-commit at gcc dot gnu.org
2021-10-18 21:01 ` cvs-commit at gcc dot gnu.org
2021-10-27 19:27 ` ubizjak at gmail dot com
2021-10-27 19:29 ` cvs-commit at gcc dot gnu.org
2021-10-27 19:30 ` ubizjak at gmail dot com

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).