public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/86869] ICE when taking address of array member of __memx struct pointer
       [not found] <bug-86869-4@http.gcc.gnu.org/bugzilla/>
@ 2023-12-04 12:30 ` rguenth at gcc dot gnu.org
  2023-12-05  7:31 ` cvs-commit at gcc dot gnu.org
  2023-12-05  7:32 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-04 12:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |c
   Last reconfirmed|                            |2023-12-04
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
It still ICEs.  The IL from the frontend looks wrong.  We have

  p = &s->y;

but we should have a ADDR_SPACE_CONVERT_EXPR here, but we have

 <decl_expr 0x7ffff6b2d7e0
    type <void_type 0x7ffff6a210a8 void VOID
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6a210a8
        pointer_to_this <pointer_type 0x7ffff6a21150>>
    side-effects
    arg:0 <var_decl 0x7ffff6b62000 p
        type <pointer_type 0x7ffff6b45e70 type <array_type 0x7ffff6b45dc8>
            unsigned HI
...

and its DECL_INITIAL is

 <nop_expr 0x7ffff6b2d7c0
    type <pointer_type 0x7ffff6b45e70
        type <array_type 0x7ffff6b45dc8 type <integer_type 0x7ffff6a2a0a8 char>
            HI
            size <integer_cst 0x7ffff6a0ba98 constant 16>
            unit-size <integer_cst 0x7ffff6a0bab0 constant 2>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6b45dc8 domain <integer_type 0x7ffff6b45930>
            pointer_to_this <pointer_type 0x7ffff6b45e70>>
        unsigned HI size <integer_cst 0x7ffff6a0ba98 16> unit-size <integer_cst
0x7ffff6a0bab0 2>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6b45e70>
    readonly
    arg:0 <addr_expr 0x7ffff6b2d7a0
        type <pointer_type 0x7ffff6b45d20 type <array_type 0x7ffff6b45c78>
            unsigned HI size <integer_cst 0x7ffff6a0ba98 16> unit-size
<integer_cst 0x7ffff6a0bab0 2>
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff6b45d20>
        readonly
        arg:0 <component_ref 0x7ffff6b5f120 type <array_type 0x7ffff6b45c78>
            readonly
            arg:0 <indirect_ref 0x7ffff6b2d780 type <record_type 0x7ffff6b45a80
S address-space-7>
                readonly arg:0 <parm_decl 0x7ffff7fc8080 s>
                t.c:6:26 start: t.c:6:26 finish: t.c:6:27> arg:1 <field_decl
0x7ffff6a28e40 y>
            t.c:6:26 start: t.c:6:25 finish: t.c:6:28>
        t.c:6:24 start: t.c:6:24 finish: t.c:6:28>
    t.c:6:24 start: t.c:6:24 finish: t.c:6:28>

and the issue is that while the RECORD_TYPE has the correct address-space
qualification the array-type does not (the array-type component does).

That's the fault of the C frontend c_build_qualified_type which
special-cases ARRAY_TYPE and doesn't behave like build_array_type_1 would.

I have a fix.

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

* [Bug c/86869] ICE when taking address of array member of __memx struct pointer
       [not found] <bug-86869-4@http.gcc.gnu.org/bugzilla/>
  2023-12-04 12:30 ` [Bug c/86869] ICE when taking address of array member of __memx struct pointer rguenth at gcc dot gnu.org
@ 2023-12-05  7:31 ` cvs-commit at gcc dot gnu.org
  2023-12-05  7:32 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-05  7:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

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

commit r14-6133-ge00c00730912cd6072954cd2c29ca44e33dbb598
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Dec 4 13:31:35 2023 +0100

    c/86869 - preserve address-space info when building qualified ARRAY_TYPE

    The following adjusts the C FE specific qualified type building
    to preserve address-space info also for ARRAY_TYPE.

            PR c/86869
    gcc/c/
            * c-typeck.cc (c_build_qualified_type): Preserve address-space
            info for ARRAY_TYPE.

    gcc/testsuite/
            * gcc.target/avr/pr86869.c: New testcase.

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

* [Bug c/86869] ICE when taking address of array member of __memx struct pointer
       [not found] <bug-86869-4@http.gcc.gnu.org/bugzilla/>
  2023-12-04 12:30 ` [Bug c/86869] ICE when taking address of array member of __memx struct pointer rguenth at gcc dot gnu.org
  2023-12-05  7:31 ` cvs-commit at gcc dot gnu.org
@ 2023-12-05  7:32 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-05  7:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk.

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

end of thread, other threads:[~2023-12-05  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-86869-4@http.gcc.gnu.org/bugzilla/>
2023-12-04 12:30 ` [Bug c/86869] ICE when taking address of array member of __memx struct pointer rguenth at gcc dot gnu.org
2023-12-05  7:31 ` cvs-commit at gcc dot gnu.org
2023-12-05  7:32 ` 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).