[Bug c/70891] New: "register name not specified" for const qualified register variable

jens.gustedt at inria dot fr gcc-bugzilla@gcc.gnu.org
Sun May 1 10:26:00 GMT 2016


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

            Bug ID: 70891
           Summary: "register name not specified" for const qualified
                    register variable
           Product: gcc
           Version: 5.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.gustedt at inria dot fr
  Target Milestone: ---

Created attachment 38387
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38387&action=edit
complete example to reproduce the bug

Gcc in different variants (I tried 4.8, 4.9 and 5.3) gives an error for

  register const struct large max4 = { .x0 = -1, .x1 = -1, };

Where large is just a struct consisting of two unsigned.
the error is

   gcc-register-const-bug.c:27:31: error: register name not specified for
'max4'

which seems to refer to the "asm register" extension of gcc, but which isn't
used here at all.

The example is minimal in the sense that *any* of the following has the bug
disappear

 - removing the const qualification
 - removing the register storage class
 - changing any of the initial values from -1 to 0

I attach a complete example that on my machine (x86_64) errors out exactly on
the line as indicated. All other variants in that file compile just fine.

As another data point, clang, in different versions, has no problem with this
code at all.
Thanks
Jens


More information about the Gcc-bugs mailing list