Menu

#546 gcc 6.1.0: ICE with -mx32

v1.0 (example)
closed-invalid
nobody
None
5
2016-07-22
2016-07-20
Thomas B
No
void
bar(int v)
{
    short w[v];
}
>gcc -mx32 bar.c
bar.c: In function 'bar':
bar.c:5:8: internal compiler error: in copy_to_mode_reg, at explow.c:601
  short w[v];
        ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://sourceforge.net/projects/mingw-w64> for instructions.
>gcc --version
gcc (x86_64-win32-sjlj, Built by MinGW-W64 project) 6.1.0

Discussion

  • niXman

    niXman - 2016-07-20

    What is 'x32' ?

     
  • Thomas B

    Thomas B - 2016-07-20

    https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/x86-Options.html#x86-Options

    "The -mx32 option sets int, long, and pointer types to 32 bits, and generates code for the x86-64 architecture. "

     
    • niXman

      niXman - 2016-07-20

      My other builds(4.9,5.3,5.4) produce the same error?

       

      Last edit: niXman 2016-07-20
      • Thomas B

        Thomas B - 2016-07-20

        All these versions do: 4.8.3, 4.9.2, 5.1.0, 5.2.0, 5.3.0, 5.4.0, 6.1.0

         

        Last edit: Thomas B 2016-07-20
  • Ozkan Sezer

    Ozkan Sezer - 2016-07-20

    An ICE isn't a good thing, but AFAIK -mx32 hasn't ever been valid for x64 either. (have we ever had an x32 abi for windows???)

     
    • Thomas B

      Thomas B - 2016-07-21

      As far as I can tell code compiled with -mx32 works just fine but since there is no x32 ABI the use is limited. Calling library functions that pass parameters in register and on the stack (e.g. printf) work fine but as soon as you need to pass around structs that contain pointers things break.
      A user could however write a wrapper for those functions, compile it with -m64 and link it to the code compiled with -mx32.

      Leaving this feature in a half broken state does not feel right, so I think the best option here ist to fix the bugs and warn the user about the shortcomings or disable the feature entirely.

       
  • niXman

    niXman - 2016-07-21
     
    • Thomas B

      Thomas B - 2016-07-21

      I think there was a missunderstanding: all other versions I listed produce the error too, not just 6.1.0.

       
      • niXman

        niXman - 2016-07-21

        Fixed.

         
  • niXman

    niXman - 2016-07-22

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

    Oh this should just error out. X32 is not supported on Windows targets.

     
  • niXman

    niXman - 2016-07-22

    Closed.

     
  • niXman

    niXman - 2016-07-22
    • status: open --> closed-invalid
     

Log in to post a comment.