public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059
@ 2022-05-08  6:10 vital.had at gmail dot com
  2022-05-08  7:54 ` [Bug target/105522] " iains at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2022-05-08  6:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105522
           Summary: gcc11: internal compiler error: in decode_addr_const,
                    at varasm.c:3059
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vital.had at gmail dot com
                CC: iains at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc-apple-darwin

Created attachment 52938
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52938&action=edit
Build log in a case needed

```
36-111% /opt/local/bin/gcc-mp-11 -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H
-I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/build/include
-I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/include
-pipe -Os -DNDEBUG -I/opt/local/include -idirafter
"/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/video/khronos"
-I/opt/local/include/libusb-1.0 -D_THREAD_SAFE -Wshadow -fvisibility=hidden
-Wdeclaration-after-statement -fno-strict-aliasing -Wall  -arch ppc
-mmacosx-version-min=10.6 -fPIC -MD -MT
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o -MF
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o.d -o
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o -c
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/SDL_hidapi.c
In file included from
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/SDL_hidapi.c:578:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'PLATFORM_free_hid_device':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:163:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  163 |         struct input_report *rpt = dev->input_reports;
      |         ^~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'get_string_property':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:265:17:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  265 |                 CFIndex str_len = CFStringGetLength(str);
      |                 ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:269:17:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  269 |                 CFIndex used_buf_len;
      |                 ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'get_string_property_utf8':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:304:17:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  304 |                 CFIndex str_len = CFStringGetLength(str);
      |                 ^~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:308:17:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  308 |                 CFIndex used_buf_len;
      |                 ^~~~~~~
In file included from
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/SDL_hidapi.c:578:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'PLATFORM_hid_enumerate':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:530:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  530 |         CFSetRef device_set = IOHIDManagerCopyDevices(hid_mgr);
      |         ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:540:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  540 |         IOHIDDeviceRef *device_array =
(IOHIDDeviceRef*)calloc(num_devices, sizeof(IOHIDDeviceRef));
      |         ^~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'PLATFORM_read_thread':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:742:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  742 |         CFRunLoopSourceContext ctx;
      |         ^~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:759:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  759 |         SInt32 code;
      |         ^~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'PLATFORM_hid_open_path':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:812:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  812 |         CFSetRef device_set = IOHIDManagerCopyDevices(hid_mgr);
      |         ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:815:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  815 |         IOHIDDeviceRef *device_array = (IOHIDDeviceRef
*)calloc(num_devices, sizeof(IOHIDDeviceRef));
      |         ^~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:848:33:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  848 |                                 struct hid_device_list_node *node =
(struct hid_device_list_node *)calloc(1, sizeof(struct hid_device_list_node));
      |                                 ^~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'PLATFORM_hid_get_feature_report':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:1091:9:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
 1091 |         int skipped_report_id = 0;
      |         ^~~
In file included from
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/SDL_hidapi.c:578:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'create_usage_match':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/mac/hid.c:407:21:
internal compiler error: in decode_addr_const, at varasm.c:3059
  407 |         const void *keys[2] = { (void *)
CFSTR(kIOHIDDeviceUsagePageKey), (void *) CFSTR(kIOHIDDeviceUsageKey) };
      |                     ^~~~
```

`-save-temps` fails to produce i file, but gives the following output:
```
36-111% sudo /opt/local/bin/gcc-mp-11 -save-temps -v -DSDL2_EXPORTS
-DUSING_GENERATED_CONFIG_H
-I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/build/include
-I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/include
-pipe -Os -DNDEBUG -I/opt/local/include -idirafter
"/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/video/khronos"
-I/opt/local/include/libusb-1.0 -D_THREAD_SAFE -Wshadow -fvisibility=hidden
-Wdeclaration-after-statement -fno-strict-aliasing -Wall  -arch ppc
-mmacosx-version-min=10.6 -fPIC -MD -MT
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o -MF
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o.d -o
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o -c
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/SDL_hidapi.c
gcc-mp-11: warning: '-pipe' ignored because '-save-temps' specified
Using built-in specs.
COLLECT_GCC=/opt/local/bin/gcc-mp-11
Target: ppc-apple-darwin10
Configured with:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_gcc11/gcc11/work/gcc-11.3.0/configure
--prefix=/opt/local --build=ppc-apple-darwin10
--enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc11
--includedir=/opt/local/include/gcc11 --infodir=/opt/local/share/info
--mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-11
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-suffix=-mp-11 --with-gxx-include-dir=/opt/local/include/gcc11/c++/
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local
--with-isl=/opt/local --with-zstd=/opt/local --enable-stage1-checking
--disable-multilib --enable-lto --enable-libstdcxx-time
--with-build-config=bootstrap-debug
--with-bugurl=https://trac.macports.org/newticket --enable-host-shared
--with-tune-cpu=G5 --disable-tls --with-as=/opt/local/bin/as
--with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar
--with-pkgversion='MacPorts gcc11 11.3.0_0'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (MacPorts gcc11 11.3.0_0) 
COLLECT_GCC_OPTIONS='-save-temps' '-v' '-D' 'SDL2_EXPORTS' '-D'
'USING_GENERATED_CONFIG_H' '-I'
'/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/build/include'
'-I'
'/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/include'
'-pipe' '-Os' '-D' 'NDEBUG' '-I' '/opt/local/include' '-idirafter'
'/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/video/khronos'
'-I' '/opt/local/include/libusb-1.0' '-D' '_THREAD_SAFE' '-Wshadow'
'-fvisibility=hidden' '-Wdeclaration-after-statement' '-fno-strict-aliasing'
'-Wall' '-fPIC' '-MD' '-MT' 'CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o'
'-MF' 'CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o.d' '-o'
'CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o' '-c' '-m32'
'-mmacosx-version-min=10.6' '-asm_macosx_version_min=10.6' '-nodefaultexport'
'-dumpdir' 'CMakeFiles/SDL2.dir/src/hidapi/'
 /opt/local/libexec/gcc/ppc-apple-darwin10/11.3.0/cc1 -E -quiet -v -I
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/build/include
-I
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/include
-I /opt/local/include -I /opt/local/include/libusb-1.0 -MD
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.d -MF
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o.d -MT
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.o -D__DYNAMIC__ -D SDL2_EXPORTS -D
USING_GENERATED_CONFIG_H -D NDEBUG -D _THREAD_SAFE -idirafter
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/video/khronos
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/hidapi/SDL_hidapi.c
-fPIC -m32 -mmacosx-version-min=10.6 -Wshadow -Wdeclaration-after-statement
-Wall -fvisibility=hidden -fno-strict-aliasing -fPIC -Os -fpch-preprocess -o
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.i
ignoring nonexistent directory
"/opt/local/lib/gcc11/gcc/ppc-apple-darwin10/11.3.0/../../../../../ppc-apple-darwin10/include"
ignoring duplicate directory "/opt/local/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/build/include

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/include
 /opt/local/include/libusb-1.0
 /opt/local/lib/gcc11/gcc/ppc-apple-darwin10/11.3.0/include
 /opt/local/include
 /opt/local/lib/gcc11/gcc/ppc-apple-darwin10/11.3.0/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2/libsdl2/work/SDL2-2.0.22/src/video/khronos
End of search list.
cc1: fatal error: opening output file
CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.i: No such file or directory
compilation terminated.
```

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

* [Bug target/105522] gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
@ 2022-05-08  7:54 ` iains at gcc dot gnu.org
  2022-05-08  8:08 ` vital.had at gmail dot com
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: iains at gcc dot gnu.org @ 2022-05-08  7:54 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2022-05-08

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
I am not going to be able to make any progress on this without a .i file (it is
not an error that I've seen in any testing).

====

> CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.i: No such file or directory

Perhaps that directory has not been created at the time you are trying to run
the command...

please take the -save-temps command and see if you can simplify it to just get
it to produce output in the current directory.

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

* [Bug target/105522] gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
  2022-05-08  7:54 ` [Bug target/105522] " iains at gcc dot gnu.org
@ 2022-05-08  8:08 ` vital.had at gmail dot com
  2022-05-08  8:09 ` vital.had at gmail dot com
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2022-05-08  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Iain Sandoe from comment #1)
> I am not going to be able to make any progress on this without a .i file (it
> is not an error that I've seen in any testing).
> 
> ====
> 
> > CMakeFiles/SDL2.dir/src/hidapi/SDL_hidapi.c.i: No such file or directory
> 
> Perhaps that directory has not been created at the time you are trying to
> run the command...
> 
> please take the -save-temps command and see if you can simplify it to just
> get it to produce output in the current directory.

I am sorry, I stupidly ran command from a wrong directory. I produced the file
now.

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

* [Bug target/105522] gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
  2022-05-08  7:54 ` [Bug target/105522] " iains at gcc dot gnu.org
  2022-05-08  8:08 ` vital.had at gmail dot com
@ 2022-05-08  8:09 ` vital.had at gmail dot com
  2022-05-08  9:05 ` iains at gcc dot gnu.org
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2022-05-08  8:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sergey Fedorov <vital.had at gmail dot com> ---
Created attachment 52939
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52939&action=edit
save-temps file

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

* [Bug target/105522] gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (2 preceding siblings ...)
  2022-05-08  8:09 ` vital.had at gmail dot com
@ 2022-05-08  9:05 ` iains at gcc dot gnu.org
  2022-05-08  9:31 ` vital.had at gmail dot com
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: iains at gcc dot gnu.org @ 2022-05-08  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|WAITING                     |NEW

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
I can repeat this with the 11.3-darwin-r0 release build on powwerpc-darwin9.

Do you happen to know if this previously worked with GCC 11 and/or earlier, if
so please could you identify what the last known working version was.  Thanks.

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

* [Bug target/105522] gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (3 preceding siblings ...)
  2022-05-08  9:05 ` iains at gcc dot gnu.org
@ 2022-05-08  9:31 ` vital.had at gmail dot com
  2022-05-08 14:31 ` [Bug target/105522] [powerpc-darwin] ICE: " iains at gcc dot gnu.org
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2022-05-08  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Iain Sandoe from comment #4)
> I can repeat this with the 11.3-darwin-r0 release build on powwerpc-darwin9.
> 
> Do you happen to know if this previously worked with GCC 11 and/or earlier,
> if so please could you identify what the last known working version was. 
> Thanks.

Unfortunately, no. I will try to test it and provide an update in awhile. (The
technical difficulty is that due to changes in libgcc, I only have 11.3.0
working on 10.6, and on 10.5.8 the port doesn’t yet build for different
reasons.)

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (4 preceding siblings ...)
  2022-05-08  9:31 ` vital.had at gmail dot com
@ 2022-05-08 14:31 ` iains at gcc dot gnu.org
  2022-05-08 16:11 ` vital.had at gmail dot com
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: iains at gcc dot gnu.org @ 2022-05-08 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
it seems to fail "forever" (at least back to 5.5)

minimal reproducer:

typedef const struct __CFString * CFStringRef;

static void
create_usage_match(const unsigned int page, const unsigned int usage, int
*okay)
{

 const void *keys[2] = 
   { (void *) ((CFStringRef) __builtin___CFStringMakeConstantString (""
"DeviceUsagePage" ""))
   , (void *) ((CFStringRef) __builtin___CFStringMakeConstantString (""
"DeviceUsage" ""))
   };

}

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (5 preceding siblings ...)
  2022-05-08 14:31 ` [Bug target/105522] [powerpc-darwin] ICE: " iains at gcc dot gnu.org
@ 2022-05-08 16:11 ` vital.had at gmail dot com
  2022-11-01  0:36 ` vital.had at gmail dot com
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2022-05-08 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Iain Sandoe from comment #6)
> it seems to fail "forever" (at least back to 5.5)
> 
> minimal reproducer:
> 
> typedef const struct __CFString * CFStringRef;
> 
> static void
> create_usage_match(const unsigned int page, const unsigned int usage, int
> *okay)
> {
> 
>  const void *keys[2] = 
>    { (void *) ((CFStringRef) __builtin___CFStringMakeConstantString (""
> "DeviceUsagePage" ""))
>    , (void *) ((CFStringRef) __builtin___CFStringMakeConstantString (""
> "DeviceUsage" ""))
>    };
> 
> }

Oh wow. Surprising that it never got caught until gcc11.

P. S. Thank you very much for dealing with this!

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (6 preceding siblings ...)
  2022-05-08 16:11 ` vital.had at gmail dot com
@ 2022-11-01  0:36 ` vital.had at gmail dot com
  2023-07-17 10:33 ` vital.had at gmail dot com
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2022-11-01  0:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Iain Sandoe from comment #6)
> it seems to fail "forever" (at least back to 5.5)

Any chance of fixing this before the next update of GCC?

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (7 preceding siblings ...)
  2022-11-01  0:36 ` vital.had at gmail dot com
@ 2023-07-17 10:33 ` vital.had at gmail dot com
  2024-01-18 13:55 ` cvs-commit at gcc dot gnu.org
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2023-07-17 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Sergey Fedorov <vital.had at gmail dot com> ---
Just to update, GCC 12.3.0 exhibits the same error:

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2-snowleopard/libsdl2-snowleopard/work/SDL2-2.0.22/src/hidapi/mac/hid.c:
In function 'create_usage_match':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_libsdl2-snowleopard/libsdl2-snowleopard/work/SDL2-2.0.22/src/hidapi/mac/hid.c:407:21:
internal compiler error: in decode_addr_const, at varasm.cc:3083
  407 |         const void *keys[2] = { (void *)
CFSTR(kIOHIDDeviceUsagePageKey), (void *) CFSTR(kIOHIDDeviceUsageKey) };
      |                     ^~~~
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://trac.macports.org/newticket> for instructions.
make: *** [build/SDL_hidapi.lo] Error 1

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (8 preceding siblings ...)
  2023-07-17 10:33 ` vital.had at gmail dot com
@ 2024-01-18 13:55 ` cvs-commit at gcc dot gnu.org
  2024-01-18 14:34 ` vital.had at gmail dot com
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-18 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

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

commit r14-8232-gaecc0d4ba73d0810334b351da1e67232cea450d3
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 6 10:52:38 2024 +0000

    Darwin: Fix constant CFString code-gen [PR105522].

    Although this only fires for one of the Darwin sub-ports, it is latent
    elsewhere, it is also a regression c.f. the Darwin system compiler.

    In the code we imported from an earlier branch, CFString objects (which
    are constant aggregates) are constructed as CONST_DECLs.  Although our
    current documentation suggests that these are reserved for enumeration
    values, in fact they are used elsewhere in the compiler for constants.
    This includes Objective-C where they are used to form NSString constants.

    In the particular case, we take the address of the constant and that
    triggers varasm.cc:decode_addr_constant, which does not currently support
    CONST_DECL.

    If there is a general intent to allow/encourage wider use of CONST_DECL,
    then we should fix decode_addr_constant to look through these and evaluate
    the initializer (a two-line patch, but I'm not suggesting it for stage-4).

    We also need to update the GCC internals documentation to allow for the
    additional uses.

    This patch is Darwin-local and fixes the problem by making the CFString
    constants into regular variable but TREE_CONSTANT+TREE_READONLY. I plan
    to back-port this to the open branches once it has baked a while on trunk.

    Since, for Darwin, the Objective-C default is to construct constant
    NSString objects as CFStrings; this will also cover the majority of cases
    there (this patch does not make any changes to Objective-C NSStrings).

            PR target/105522

    gcc/ChangeLog:

            * config/darwin.cc (machopic_select_section): Handle C and C++
            CFStrings.
            (darwin_rename_builtins): Move this out of the CFString code.
            (darwin_libc_has_function): Likewise.
            (darwin_build_constant_cfstring): Create an anonymous var to
            hold each CFString.
            * config/darwin.h (ASM_OUTPUT_LABELREF): Handle constant
            CFstrings.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (9 preceding siblings ...)
  2024-01-18 13:55 ` cvs-commit at gcc dot gnu.org
@ 2024-01-18 14:34 ` vital.had at gmail dot com
  2024-03-03 21:13 ` bergner at gcc dot gnu.org
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2024-01-18 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to GCC Commits from comment #10)
> The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

Iain, thank you very much for addressing this!

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (10 preceding siblings ...)
  2024-01-18 14:34 ` vital.had at gmail dot com
@ 2024-03-03 21:13 ` bergner at gcc dot gnu.org
  2024-03-03 22:00 ` iains at gcc dot gnu.org
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: bergner at gcc dot gnu.org @ 2024-03-03 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

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

--- Comment #12 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Sergey Fedorov from comment #11)
> (In reply to GCC Commits from comment #10)
> > The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:
> 
> Iain, thank you very much for addressing this!

If this is fixed for you, can you please move this to RESOLVED / FIXED?

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (11 preceding siblings ...)
  2024-03-03 21:13 ` bergner at gcc dot gnu.org
@ 2024-03-03 22:00 ` iains at gcc dot gnu.org
  2024-03-18 12:53 ` vital.had at gmail dot com
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: iains at gcc dot gnu.org @ 2024-03-03 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed on trunk, intending to backport it.

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (12 preceding siblings ...)
  2024-03-03 22:00 ` iains at gcc dot gnu.org
@ 2024-03-18 12:53 ` vital.had at gmail dot com
  2024-03-18 12:55 ` vital.had at gmail dot com
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2024-03-18 12:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Iain Sandoe from comment #13)
> fixed on trunk, intending to backport it.

Great! Once it is on your branches, hopefully Macports borrows the patch as
well.

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (13 preceding siblings ...)
  2024-03-18 12:53 ` vital.had at gmail dot com
@ 2024-03-18 12:55 ` vital.had at gmail dot com
  2024-03-18 16:09 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: vital.had at gmail dot com @ 2024-03-18 12:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Peter Bergner from comment #12)
> (In reply to Sergey Fedorov from comment #11)
> > (In reply to GCC Commits from comment #10)
> > > The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:
> > 
> > Iain, thank you very much for addressing this!
> 
> If this is fixed for you, can you please move this to RESOLVED / FIXED?

I will need to rebuild gcc13 and try it out, allow me some time please.

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (14 preceding siblings ...)
  2024-03-18 12:55 ` vital.had at gmail dot com
@ 2024-03-18 16:09 ` iains at gcc dot gnu.org
  2024-03-31 12:47 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: iains at gcc dot gnu.org @ 2024-03-18 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Sergey Fedorov from comment #15)
> (In reply to Peter Bergner from comment #12)
> > (In reply to Sergey Fedorov from comment #11)
> > > (In reply to GCC Commits from comment #10)
> > > > The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:
> > > 
> > > Iain, thank you very much for addressing this!
> > 
> > If this is fixed for you, can you please move this to RESOLVED / FIXED?
> 
> I will need to rebuild gcc13 and try it out, allow me some time please.

it is only fixed on trunk so far - I am currently working on back ports to
earlier branches and this will be one of them - so please leave open for now.

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (15 preceding siblings ...)
  2024-03-18 16:09 ` iains at gcc dot gnu.org
@ 2024-03-31 12:47 ` cvs-commit at gcc dot gnu.org
  2024-04-19 13:14 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-31 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

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

commit r13-8537-gbd760ac35d792683cd82f6b665516528fe11752a
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 6 10:52:38 2024 +0000

    Darwin: Fix constant CFString code-gen [PR105522].

    Although this only fires for one of the Darwin sub-ports, it is latent
    elsewhere, it is also a regression c.f. the Darwin system compiler.

    In the code we imported from an earlier branch, CFString objects (which
    are constant aggregates) are constructed as CONST_DECLs.  Although our
    current documentation suggests that these are reserved for enumeration
    values, in fact they are used elsewhere in the compiler for constants.
    This includes Objective-C where they are used to form NSString constants.

    In the particular case, we take the address of the constant and that
    triggers varasm.cc:decode_addr_constant, which does not currently support
    CONST_DECL.

    If there is a general intent to allow/encourage wider use of CONST_DECL,
    then we should fix decode_addr_constant to look through these and evaluate
    the initializer (a two-line patch, but I'm not suggesting it for stage-4).

    We also need to update the GCC internals documentation to allow for the
    additional uses.

    This patch is Darwin-local and fixes the problem by making the CFString
    constants into regular variable but TREE_CONSTANT+TREE_READONLY. I plan
    to back-port this to the open branches once it has baked a while on trunk.

    Since, for Darwin, the Objective-C default is to construct constant
    NSString objects as CFStrings; this will also cover the majority of cases
    there (this patch does not make any changes to Objective-C NSStrings).

            PR target/105522

    gcc/ChangeLog:

            * config/darwin.cc (machopic_select_section): Handle C and C++
            CFStrings.
            (darwin_rename_builtins): Move this out of the CFString code.
            (darwin_libc_has_function): Likewise.
            (darwin_build_constant_cfstring): Create an anonymous var to
            hold each CFString.
            * config/darwin.h (ASM_OUTPUT_LABELREF): Handle constant
            CFstrings.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    (cherry picked from commit aecc0d4ba73d0810334b351da1e67232cea450d3)

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (16 preceding siblings ...)
  2024-03-31 12:47 ` cvs-commit at gcc dot gnu.org
@ 2024-04-19 13:14 ` cvs-commit at gcc dot gnu.org
  2024-04-28 14:35 ` cvs-commit at gcc dot gnu.org
  2024-04-28 14:46 ` iains at gcc dot gnu.org
  19 siblings, 0 replies; 21+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-19 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

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

commit r12-10348-gb9ee0c8830592212678c402aed8a6b11ef8d2640
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 6 10:52:38 2024 +0000

    Darwin: Fix constant CFString code-gen [PR105522].

    Although this only fires for one of the Darwin sub-ports, it is latent
    elsewhere, it is also a regression c.f. the Darwin system compiler.

    In the code we imported from an earlier branch, CFString objects (which
    are constant aggregates) are constructed as CONST_DECLs.  Although our
    current documentation suggests that these are reserved for enumeration
    values, in fact they are used elsewhere in the compiler for constants.
    This includes Objective-C where they are used to form NSString constants.

    In the particular case, we take the address of the constant and that
    triggers varasm.cc:decode_addr_constant, which does not currently support
    CONST_DECL.

    If there is a general intent to allow/encourage wider use of CONST_DECL,
    then we should fix decode_addr_constant to look through these and evaluate
    the initializer (a two-line patch, but I'm not suggesting it for stage-4).

    We also need to update the GCC internals documentation to allow for the
    additional uses.

    This patch is Darwin-local and fixes the problem by making the CFString
    constants into regular variable but TREE_CONSTANT+TREE_READONLY. I plan
    to back-port this to the open branches once it has baked a while on trunk.

    Since, for Darwin, the Objective-C default is to construct constant
    NSString objects as CFStrings; this will also cover the majority of cases
    there (this patch does not make any changes to Objective-C NSStrings).

            PR target/105522

    gcc/ChangeLog:

            * config/darwin.cc (machopic_select_section): Handle C and C++
            CFStrings.
            (darwin_rename_builtins): Move this out of the CFString code.
            (darwin_libc_has_function): Likewise.
            (darwin_build_constant_cfstring): Create an anonymous var to
            hold each CFString.
            * config/darwin.h (ASM_OUTPUT_LABELREF): Handle constant
            CFstrings.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    (cherry picked from commit aecc0d4ba73d0810334b351da1e67232cea450d3)

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (17 preceding siblings ...)
  2024-04-19 13:14 ` cvs-commit at gcc dot gnu.org
@ 2024-04-28 14:35 ` cvs-commit at gcc dot gnu.org
  2024-04-28 14:46 ` iains at gcc dot gnu.org
  19 siblings, 0 replies; 21+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-28 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

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

commit r11-11385-ga1b0ace9737a40957bfb298de22066d8ee9a6603
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 6 10:52:38 2024 +0000

    Darwin: Fix constant CFString code-gen [PR105522].

    Although this only fires for one of the Darwin sub-ports, it is latent
    elsewhere, it is also a regression c.f. the Darwin system compiler.

    In the code we imported from an earlier branch, CFString objects (which
    are constant aggregates) are constructed as CONST_DECLs.  Although our
    current documentation suggests that these are reserved for enumeration
    values, in fact they are used elsewhere in the compiler for constants.
    This includes Objective-C where they are used to form NSString constants.

    In the particular case, we take the address of the constant and that
    triggers varasm.cc:decode_addr_constant, which does not currently support
    CONST_DECL.

    If there is a general intent to allow/encourage wider use of CONST_DECL,
    then we should fix decode_addr_constant to look through these and evaluate
    the initializer (a two-line patch, but I'm not suggesting it for stage-4).

    We also need to update the GCC internals documentation to allow for the
    additional uses.

    This patch is Darwin-local and fixes the problem by making the CFString
    constants into regular variable but TREE_CONSTANT+TREE_READONLY. I plan
    to back-port this to the open branches once it has baked a while on trunk.

    Since, for Darwin, the Objective-C default is to construct constant
    NSString objects as CFStrings; this will also cover the majority of cases
    there (this patch does not make any changes to Objective-C NSStrings).

            PR target/105522

    gcc/ChangeLog:

            * config/darwin.c (machopic_select_section): Handle C and C++
            CFStrings.
            (darwin_rename_builtins): Move this out of the CFString code.
            (darwin_libc_has_function): Likewise.
            (darwin_build_constant_cfstring): Create an anonymous var to
            hold each CFString.
            * config/darwin.h (ASM_OUTPUT_LABELREF): Handle constant
            CFstrings.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    (cherry picked from commit aecc0d4ba73d0810334b351da1e67232cea450d3)

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

* [Bug target/105522] [powerpc-darwin] ICE: in decode_addr_const, at varasm.c:3059
  2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
                   ` (18 preceding siblings ...)
  2024-04-28 14:35 ` cvs-commit at gcc dot gnu.org
@ 2024-04-28 14:46 ` iains at gcc dot gnu.org
  19 siblings, 0 replies; 21+ messages in thread
From: iains at gcc dot gnu.org @ 2024-04-28 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

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

--- Comment #20 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed on open branches (needed on earlier if maintained).

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

end of thread, other threads:[~2024-04-28 14:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08  6:10 [Bug target/105522] New: gcc11: internal compiler error: in decode_addr_const, at varasm.c:3059 vital.had at gmail dot com
2022-05-08  7:54 ` [Bug target/105522] " iains at gcc dot gnu.org
2022-05-08  8:08 ` vital.had at gmail dot com
2022-05-08  8:09 ` vital.had at gmail dot com
2022-05-08  9:05 ` iains at gcc dot gnu.org
2022-05-08  9:31 ` vital.had at gmail dot com
2022-05-08 14:31 ` [Bug target/105522] [powerpc-darwin] ICE: " iains at gcc dot gnu.org
2022-05-08 16:11 ` vital.had at gmail dot com
2022-11-01  0:36 ` vital.had at gmail dot com
2023-07-17 10:33 ` vital.had at gmail dot com
2024-01-18 13:55 ` cvs-commit at gcc dot gnu.org
2024-01-18 14:34 ` vital.had at gmail dot com
2024-03-03 21:13 ` bergner at gcc dot gnu.org
2024-03-03 22:00 ` iains at gcc dot gnu.org
2024-03-18 12:53 ` vital.had at gmail dot com
2024-03-18 12:55 ` vital.had at gmail dot com
2024-03-18 16:09 ` iains at gcc dot gnu.org
2024-03-31 12:47 ` cvs-commit at gcc dot gnu.org
2024-04-19 13:14 ` cvs-commit at gcc dot gnu.org
2024-04-28 14:35 ` cvs-commit at gcc dot gnu.org
2024-04-28 14:46 ` iains 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).