public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/110174] New: Using illegal constraints for builtin return_address gives ICE
@ 2023-06-08 14:18 admin@tho-otto.de
  2023-07-22  9:39 ` [Bug modula2/110174] " gaius at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: admin@tho-otto.de @ 2023-06-08 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110174
           Summary: Using illegal constraints for builtin return_address
                    gives ICE
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: admin@tho-otto.de
  Target Milestone: ---

When compiling the the following module with -O2

MODULE foo;
FROM Builtins IMPORT return_address;
FROM SYSTEM IMPORT ADDRESS;

VAR x: ADDRESS;

PROCEDURE test();
BEGIN
  ASM VOLATILE("" : "=m"(x) : "m"(return_address(0)) : );
END test;

BEGIN
  test();
END foo.


I get an ICE:

during RTL pass: expand
In function ‘test’,
    inlined from ‘_M2_foo_init’ at foo.mod:13:3:
foo.mod:9:56: internal compiler error: in expand_asm_stmt, at cfgexpand.cc:3419
    9 |   ASM VOLATILE("" : "=m"(x) : "m"(return_address(0)) : );
      |                                                        ^

The ICE is triggered at
https://github.com/gcc-mirror/gcc/blob/9589a46ddadc8b93c224c3f84fa94746c04596bf/gcc/cfgexpand.cc#L3419

Using "m" as constraint is actually wrong, however the C backend handles that
correctly:

foo.c:5:39: error: memory input 1 is not directly addressable
    5 |   __asm__ volatile("" : "=m"(x) : "m"(__builtin_return_address(0)) : );

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

end of thread, other threads:[~2023-07-31  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 14:18 [Bug modula2/110174] New: Using illegal constraints for builtin return_address gives ICE admin@tho-otto.de
2023-07-22  9:39 ` [Bug modula2/110174] " gaius at gcc dot gnu.org
2023-07-24 19:14 ` gaius at gcc dot gnu.org
2023-07-25  2:21 ` cvs-commit at gcc dot gnu.org
2023-07-31  0:06 ` cvs-commit at gcc dot gnu.org
2023-07-31  0:08 ` gaius at gcc dot gnu.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).