In article <>,
matthew green  <> wrote:
>"Christos Zoulas" writes:
>> Module Name: src
>> Committed By:        christos
>> Date:                Wed Oct 16 15:01:56 UTC 2019
>> Modified Files:
>>      src/external/gpl3/gcc/dist/libobjc: encoding.c
>> Log Message:
>> prevent DFmode re-definition.
>i'm not a fan of this one.  i'd like to figure out
>what is really happening here..
>i've been using the same hack, but i didn't want to
>commit it because i don't understand it.

I've looked into it:
The definition comes from:

#define DFmode E_DFmode    
#define DFmode (scalar_float_mode ((scalar_float_mode::from_int) E_DFmode))

These defines are new in gcc8. The older gcc does not have E_DFmode,
and just uses the DFmode enum (which has now been renamed E_DFmode).

So the encoding.c has been changed to use the new E_DFmode in one place:

--- /usr/src/external/gpl3/gcc.old//dist/libobjc/encoding.c     2019-10-16 
17:44:57.910551512 -0400
+++ /usr/src/external/gpl3/gcc//dist/libobjc/encoding.c 2019-10-16 
17:45:05.111849735 -0400
@@ -1,5 +1,5 @@
 /* Encoding of types for Objective C.
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2018 Free Software Foundation, Inc.
    Contributed by Kresten Krab Thorup
    Bitfield support by Ovidiu Predescu
@@ -162,7 +162,7 @@
       case UNION_TYPE:
        return MAX (MAX (comp, spec), objc_alignof_type (_stp) * __CHAR_BIT__);
-      case DFmode:
+      case E_DFmode:
       case _C_LNG_LNG:
       case _C_ULNG_LNG:
        return MAX (MAX (comp, spec), 64);

The only other place DFmode is used is:

/*  FIXME: while this file has no business including tm.h, this
    definitely has no business defining this macro but it
    is only way around without really rewritting this file,
    should look after the branch of 3.4 to fix this.   */
#define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED)    \
  ({ const char *_fields = TYPE_FIELDS (STRUCT);                        \
  ((_fields != 0                                                        \
    && TYPE_MODE (strip_array_types (TREE_TYPE (_fields))) == DFmode)   \
   ? MAX (MAX (COMPUTED, SPECIFIED), 64)                                \

So think that the right fix is to change the second DFmode to E_DFmode and
then delete the re-definition.


Reply via email to