public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1
@ 2022-11-03 11:15 redi at gcc dot gnu.org
  2022-11-03 11:23 ` [Bug c++/107516] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-03 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107516
           Summary: [13 Regression] ICE with -fwide-exec-charset=latin1
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

Compiling the attached code with -std=gnu++20 -fwide-exec-charset=latin1 gives
an ICE with trunk. GCC 12 doesn't ICE, but maybe it's a
--enable-checking=release thing (no ICE even with -fchecking=3 though).



tmp$ ~/gcc/12.1/bin/g++ -std=c++20  suffix.cc -fwide-exec-charset=latin1 
tmp$ ~/gcc/13/bin/g++ -std=c++20  suffix.cc -fwide-exec-charset=latin1
-freport-bug
during RTL pass: expand
suffix.cc: In function ‘auto __units_suffix() [with _Period = std::ratio<1,
1000>; _CharT = wchar_t]’:
suffix.cc:97:22: internal compiler error: in get_constant_size, at
varasm.cc:3418
   97 |               return L##suffix;                         \
      |                      ^
suffix.cc:106:11: note: in expansion of macro ‘_GLIBCXX_UNITS_SUFFIX’
  106 |           _GLIBCXX_UNITS_SUFFIX(milli, "ms")
      |           ^~~~~~~~~~~~~~~~~~~~~
0x8a6410 get_constant_size
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3418
0x1519a88 assemble_constant_contents
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3615
0x151af15 output_constant_def_contents
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3666
0x151b264 maybe_output_constant_def_contents
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3602
0x151b264 output_constant_def(tree_node*, int)
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3568
0xe23b2e expand_expr_constant
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:8592
0xe23b2e expand_expr_addr_expr_1
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:8619
0xe24169 expand_expr_addr_expr
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:8812
0xe19464 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:12096
0xe26825 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:6330
0xe28090 expand_assignment(tree_node*, tree_node*, bool)
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:6051
0xcf589c expand_gimple_stmt_1
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:3946
0xcf589c expand_gimple_stmt
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:4044
0xcfc0ce expand_gimple_basic_block
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:6096
0xcfdbe7 execute
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:6822
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/ccsLQGSo.out file, please attach this to
your bugreport.

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

* [Bug c++/107516] [13 Regression] ICE with -fwide-exec-charset=latin1
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
@ 2022-11-03 11:23 ` redi at gcc dot gnu.org
  2022-11-05 10:54 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-03 11:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Maybe a similar issue to PR 81050, i.e. Latin1 isn't valid as a wide charset.
In which case, we should give an error instead of ICE if possible.


Reduced to remove library headers and C++20 features:

template<typename, typename> constexpr bool is_same_v = false;
template<typename T> constexpr bool is_same_v<T,T> = true;

template<typename CharT>
auto
units_suffix() noexcept
{
  if constexpr (is_same_v<CharT, wchar_t>)
    return L"ms";
  else
    return "ms";
}

int main()
{
  units_suffix<wchar_t>();
}


during RTL pass: expand
ice.cc: In function ‘auto units_suffix() [with CharT = wchar_t]’:
ice.cc:9:12: internal compiler error: in get_constant_size, at varasm.cc:3418
    9 |     return L"ms";
      |            ^~~~~
0x8a6410 get_constant_size
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3418
0x1519a88 assemble_constant_contents
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3615
0x151af15 output_constant_def_contents
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3666
0x151b264 maybe_output_constant_def_contents
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3602
0x151b264 output_constant_def(tree_node*, int)
        /home/jwakely/src/gcc/gcc/gcc/varasm.cc:3568
0xe23b2e expand_expr_constant
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:8592
0xe23b2e expand_expr_addr_expr_1
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:8619
0xe24169 expand_expr_addr_expr
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:8812
0xe19464 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:12096
0xe26825 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:6330
0xe28090 expand_assignment(tree_node*, tree_node*, bool)
        /home/jwakely/src/gcc/gcc/gcc/expr.cc:6051
0xcf589c expand_gimple_stmt_1
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:3946
0xcf589c expand_gimple_stmt
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:4044
0xcfc0ce expand_gimple_basic_block
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:6096
0xcfdbe7 execute
        /home/jwakely/src/gcc/gcc/gcc/cfgexpand.cc:6822
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.




And this does ICE "gcc version 12.0.1 20220316 (experimental) (GCC)" so it
probably is due to checking.

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

* [Bug c++/107516] [13 Regression] ICE with -fwide-exec-charset=latin1
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
  2022-11-03 11:23 ` [Bug c++/107516] " redi at gcc dot gnu.org
@ 2022-11-05 10:54 ` rguenth at gcc dot gnu.org
  2022-11-21 12:56 ` [Bug c++/107516] [13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9 marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-11-05 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

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

* [Bug c++/107516] [13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
  2022-11-03 11:23 ` [Bug c++/107516] " redi at gcc dot gnu.org
  2022-11-05 10:54 ` rguenth at gcc dot gnu.org
@ 2022-11-21 12:56 ` marxin at gcc dot gnu.org
  2022-11-21 15:40 ` [Bug c++/107516] [10/11/12/13 " pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-11-21 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13 Regression] ICE with    |[13 Regression] ICE with
                   |-fwide-exec-charset=latin1  |-fwide-exec-charset=latin1
                   |                            |since
                   |                            |r9-2891-g5ec9f8cff333bbe9
             Status|UNCONFIRMED                 |NEW
                 CC|                            |edlinger at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-11-21

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r9-2891-g5ec9f8cff333bbe9.

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

* [Bug c++/107516] [10/11/12/13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-11-21 12:56 ` [Bug c++/107516] [13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9 marxin at gcc dot gnu.org
@ 2022-11-21 15:40 ` pinskia at gcc dot gnu.org
  2023-01-13 12:35 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-21 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-checking
            Summary|[13 Regression] ICE with    |[10/11/12/13 Regression]
                   |-fwide-exec-charset=latin1  |ICE with
                   |since                       |-fwide-exec-charset=latin1
                   |r9-2891-g5ec9f8cff333bbe9   |since
                   |                            |r9-2891-g5ec9f8cff333bbe9
   Target Milestone|13.0                        |10.5

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

* [Bug c++/107516] [10/11/12/13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-11-21 15:40 ` [Bug c++/107516] [10/11/12/13 " pinskia at gcc dot gnu.org
@ 2023-01-13 12:35 ` rguenth at gcc dot gnu.org
  2023-01-13 12:40 ` jakub at gcc dot gnu.org
  2023-07-07 10:44 ` [Bug c++/107516] [11/12/13/14 " rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-13 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
3416      size = int_size_in_bytes (TREE_TYPE (exp));
3417      gcc_checking_assert (size >= 0);
3418      gcc_checking_assert (TREE_CODE (exp) != STRING_CST
3419                           || size >= TREE_STRING_LENGTH (exp));
(gdb) p size
$1 = 4
(gdb) p exp->string.length
$3 = 6
(gdb) p debug_tree (exp)
 <string_cst 0x7ffff6408b80
    type <array_type 0x7ffff6428150
        type <integer_type 0x7ffff6428000 wchar_t readonly type_6 SI
            size <integer_cst 0x7ffff628b210 constant 32>
            unit-size <integer_cst 0x7ffff628b228 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6428000 precision:32 min <integer_cst 0x7ffff628b5d0 -2147483648> max
<integer_cst 0x7ffff628b5e8 2147483647>
            pointer_to_this <pointer_type 0x7ffff6428888>>
        type_6 SI size <integer_cst 0x7ffff628b210 32> unit-size <integer_cst
0x7ffff628b228 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6428150
        domain <integer_type 0x7ffff6294d20 type <integer_type 0x7ffff6289000
sizetype>
            type_6 DI
            size <integer_cst 0x7ffff6266fc0 constant 64>
            unit-size <integer_cst 0x7ffff6266fd8 constant 8>
            align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6294d20 precision:64 min <integer_cst 0x7ffff628b000 0> max <integer_cst
0x7ffff628b000 0>>
        pointer_to_this <pointer_type 0x7ffff6428a80>>
    readonly constant asm_written static "ms\000\000\000\000">
(gdb) p debug_generic_expr (0x7ffff6428150)
const wchar_t[1]

Bernd - I see it as us having an excess 2-byte nul terminator?

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

* [Bug c++/107516] [10/11/12/13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-13 12:35 ` rguenth at gcc dot gnu.org
@ 2023-01-13 12:40 ` jakub at gcc dot gnu.org
  2023-07-07 10:44 ` [Bug c++/107516] [11/12/13/14 " rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-13 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The assumption is that for wide charsets each char is either a wchar_t or
multiple wchar_t, so I think such option is invalid; though not really sure how
we could find that out and diagnose, iconv doesn't announce such details, for
iconv everything is a series of bytes...

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

* [Bug c++/107516] [11/12/13/14 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9
  2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-13 12:40 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:44 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

end of thread, other threads:[~2023-07-07 10:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 11:15 [Bug c++/107516] New: [13 Regression] ICE with -fwide-exec-charset=latin1 redi at gcc dot gnu.org
2022-11-03 11:23 ` [Bug c++/107516] " redi at gcc dot gnu.org
2022-11-05 10:54 ` rguenth at gcc dot gnu.org
2022-11-21 12:56 ` [Bug c++/107516] [13 Regression] ICE with -fwide-exec-charset=latin1 since r9-2891-g5ec9f8cff333bbe9 marxin at gcc dot gnu.org
2022-11-21 15:40 ` [Bug c++/107516] [10/11/12/13 " pinskia at gcc dot gnu.org
2023-01-13 12:35 ` rguenth at gcc dot gnu.org
2023-01-13 12:40 ` jakub at gcc dot gnu.org
2023-07-07 10:44 ` [Bug c++/107516] [11/12/13/14 " rguenth 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).