public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112499] New: GCC: 14: internal compiler error: output_operand: invalid expression as operand
@ 2023-11-13  2:28 141242068 at smail dot nju.edu.cn
  2023-11-13  2:47 ` [Bug middle-end/112499] [11/12/13/14 Regression] ICE in output_operand: invalid expression as operand with addition of 2 differences of address of labels pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: 141242068 at smail dot nju.edu.cn @ 2023-11-13  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112499
           Summary: GCC: 14: internal compiler error: output_operand:
                    invalid expression as operand
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

Compiler Explorer: https://gcc.godbolt.org/z/MdacfWqhr

When attempting to compile this program with `gcc-14 -O1`, gcc crashes:
```
#include <stdint.h>

int f(void) {
  static uintptr_t a = ((char *)&&l3 - (char *)&&l2) +
                       ((char *)&&l1 - (char *)&&l2);
l1:
l2:
l3:
  return a;
}
```

If removing the qualifier `static`, then this crash disappears.

The crash output:
```
<source>:10:1: internal compiler error: output_operand: invalid expression as
operand
   10 | }
      | ^
0x238b15e internal_error(char const*, ...)
        ???:0
0xd01147 output_operand_lossage(char const*, ...)
        ???:0
0xd01c71 output_addr_const(_IO_FILE*, rtx_def*)
        ???:0
0xd01a53 output_addr_const(_IO_FILE*, rtx_def*)
        ???:0
0xd01ae5 output_addr_const(_IO_FILE*, rtx_def*)
        ???:0
0x14cec92 assemble_integer_with_op(char const*, rtx_def*)
        ???:0
0x14cecf1 default_assemble_integer(rtx_def*, unsigned int, int)
        ???:0
0x14ced7f assemble_integer(rtx_def*, unsigned int, unsigned int, int)
        ???:0
0x14e1cae assemble_variable(tree_node*, int, int, int)
        ???:0
0x14e62ae symbol_table::output_variables()
        ???:0
0xc027bb symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

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

end of thread, other threads:[~2024-04-07  5:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-13  2:28 [Bug c/112499] New: GCC: 14: internal compiler error: output_operand: invalid expression as operand 141242068 at smail dot nju.edu.cn
2023-11-13  2:47 ` [Bug middle-end/112499] [11/12/13/14 Regression] ICE in output_operand: invalid expression as operand with addition of 2 differences of address of labels pinskia at gcc dot gnu.org
2023-11-13  2:47 ` pinskia at gcc dot gnu.org
2023-11-13 14:25 ` jakub at gcc dot gnu.org
2024-03-07 21:02 ` law at gcc dot gnu.org
2024-03-12 13:22 ` jakub at gcc dot gnu.org
2024-03-19 16:49 ` jakub at gcc dot gnu.org
2024-04-07  5:32 ` pinskia 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).