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

            Bug ID: 63824
           Summary: [5.0 Regression]: ICE with -mcmodel=large -fpic and
                    pseudo PIC
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com

This ICE can be seen in [1] as FAIL: g++.dg/other/pr53811.C on Darwin, but can
be triggered also on x86_64 linux with -mcmodel=large -fpic

The problem starts in x86_output_mi_thunk, where we have:

      if (ix86_cmodel == CM_LARGE_PIC && SYMBOLIC_CONST (fnaddr))
    fnaddr = legitimize_pic_address (fnaddr,
                     gen_rtx_REG (Pmode, tmp_regno));

and legitimize_pic_address does:

13537         if (reg != 0)
13538           {
13539             new_rtx = expand_simple_binop (Pmode, PLUS, reg,
pic_offset_table_rtx,
13540                                            tmpreg, 1, OPTAB_DIRECT);
13541             new_rtx = reg;
13542           }

Please note that x86_output_mi_thunk runs after reload, and the above code
emits RTX with a pseudo pic_offset_table_rtx register.

[1] https://gcc.gnu.org/ml/gcc-testresults/2014-11/msg01024.html

Reply via email to