Bug 19859 - SImode and DImode usage
Summary: SImode and DImode usage
Status: RESOLVED DUPLICATE of bug 19537
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-09 17:20 UTC by Herman ten Brugge
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target: c4x
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Herman ten Brugge 2005-02-09 17:20:15 UTC
The c4x target does not build any more because a lot of code uses SImode and
DImode for 32 and 64 bit values. This is incorrect for the c4x target because
here QImode is 32 bits and HImode is 64 bits (chars/ints/longs = 32 bits, long
long = 64 bits).

I did a quick search on the current (20050209) version and found about 113
problems. The problems are listed below. I am not sure the list is complete
but it is a start.

I the past some changes were made for example to libgcc2.h, gcov-io.h. Also for
SImode one can write TYPE_MODE (integer_type_node). The same can be done for
DImode.

The list of files+linenumbers:

/libffi/include/ffi_common.h:81:typedef unsigned int UINT32
__attribute__((__mode__(__SI__)));
./libffi/include/ffi_common.h:82:typedef signed int   SINT32
__attribute__((__mode__(__SI__)));
./libffi/include/ffi_common.h:83:typedef unsigned int UINT64
__attribute__((__mode__(__DI__)));
./libffi/include/ffi_common.h:84:typedef signed int   SINT64
__attribute__((__mode__(__DI__)));
./libffi/src/mips/ffitarget.h:128:typedef unsigned int     ffi_arg
__attribute__((__mode__(__SI__)));
./libffi/src/mips/ffitarget.h:129:typedef signed   int     ffi_sarg
__attribute__((__mode__(__SI__)));
./libffi/src/mips/ffitarget.h:132:typedef unsigned int     ffi_arg
__attribute__((__mode__(__DI__)));
./libffi/src/mips/ffitarget.h:133:typedef signed   int     ffi_sarg
__attribute__((__mode__(__DI__)));
./libffi/src/ia64/ffi.c:39:typedef void *PTR64 __attribute__((mode(DI)));
./libjava/gcj/javaprims.h:510:typedef unsigned int _Jv_uint
__attribute__((__mode__(__SI__)));
./libjava/gcj/javaprims.h:511:typedef unsigned int _Jv_ulong
__attribute__((__mode__(__DI__)));
./libjava/include/jni.h:52:typedef int    jint   __attribute__((__mode__(__SI__)));
./libjava/include/jni.h:53:typedef int    jlong  __attribute__((__mode__(__DI__)));
./libjava/java/lang/mprec.h:61:// FIXME -- this could have problems with systems
that don't define SI to be 4
./libjava/java/lang/mprec.h:62:typedef int int32_t __attribute__((mode(SI)));
./libjava/java/lang/mprec.h:68:typedef unsigned int uint32_t
__attribute__((mode(SI)));
./libjava/gnu/gcj/io/shs.h:29:typedef unsigned int uint32_t
__attribute__((mode(SI)));
./gcc/expr.c:8715:  enum machine_mode index_mode = SImode;
./gcc/loop.c:768:  reg_address_cost = address_cost (reg, SImode);
./gcc/unwind-dw2.c:86:  unsigned u4 __attribute__ ((mode (SI)));
./gcc/unwind-dw2.c:87:  unsigned u8 __attribute__ ((mode (DI)));
./gcc/unwind-dw2.c:89:  signed s4 __attribute__ ((mode (SI)));
./gcc/unwind-dw2.c:90:  signed s8 __attribute__ ((mode (DI)));
./gcc/tree.c:5683:  intSI_type_node = make_or_reuse_type (GET_MODE_BITSIZE
(SImode), 0);
./gcc/tree.c:5684:  intDI_type_node = make_or_reuse_type (GET_MODE_BITSIZE
(DImode), 0);
./gcc/tree.c:5689:  unsigned_intSI_type_node = make_or_reuse_type
(GET_MODE_BITSIZE (SImode), 1);
./gcc/tree.c:5690:  unsigned_intDI_type_node = make_or_reuse_type
(GET_MODE_BITSIZE (DImode), 1);
./gcc/coverage.c:605:  fields = build_decl (FIELD_DECL, NULL_TREE,
unsigned_intSI_type_node);
./gcc/coverage.c:608:  field = build_decl (FIELD_DECL, NULL_TREE,
unsigned_intSI_type_node);
./gcc/coverage.c:639:  value = tree_cons (fields, build_int_cstu
(unsigned_intSI_type_node,
./gcc/coverage.c:644:  value = tree_cons (fields, build_int_cstu
(unsigned_intSI_type_node,
./gcc/coverage.c:677:  field = build_decl (FIELD_DECL, NULL_TREE,
unsigned_intSI_type_node);
./gcc/coverage.c:714:                build_int_cstu (unsigned_intSI_type_node,
./gcc/coverage.c:788:  field = build_decl (FIELD_DECL, NULL_TREE,
unsigned_intSI_type_node);
./gcc/coverage.c:791:  value = tree_cons (field, build_int_cstu
(unsigned_intSI_type_node,
./gcc/coverage.c:801:  field = build_decl (FIELD_DECL, NULL_TREE,
unsigned_intSI_type_node);
./gcc/coverage.c:804:  value = tree_cons (field, build_int_cstu
(unsigned_intSI_type_node,
./gcc/loop-unswitch.c:237:  stest = simplify_gen_relational (GET_CODE (test),
SImode,
./gcc/loop-unswitch.c:243:  return canon_condition (gen_rtx_fmt_ee (GET_CODE
(test), SImode,
./gcc/optabs.c:704:  tmp = simplify_relational_operation (cmp_code, SImode,
op1_mode, cmp1, cmp2);
./gcc/optabs.c:4403:      if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE
(SImode))
./gcc/optabs.c:4404:    from = convert_to_mode (SImode, from, unsignedp);
./gcc/optabs.c:4580:  if (GET_MODE_SIZE (GET_MODE (to)) < GET_MODE_SIZE (SImode))
./gcc/optabs.c:4582:      target = gen_reg_rtx (SImode);
./gcc/cfgloopanal.c:515:  rtx reg1 = gen_raw_REG (SImode, FIRST_PSEUDO_REGISTER);
./gcc/cfgloopanal.c:516:  rtx reg2 = gen_raw_REG (SImode, FIRST_PSEUDO_REGISTER
+ 1);
./gcc/cfgloopanal.c:518:  rtx mem = validize_mem (gen_rtx_MEM (SImode, addr));
./gcc/loop-iv.c:1597:      || GET_MODE (cond) != SImode)
./gcc/loop-iv.c:1598:    cond = gen_rtx_fmt_ee (code, SImode, op0, op1);
./gcc/loop-iv.c:1842:  cond_under = simplify_gen_relational (LT, SImode,
iv->extend_mode,
./gcc/loop-iv.c:1844:  cond_over = simplify_gen_relational (GT, SImode,
iv->extend_mode,
./gcc/loop-iv.c:2166:       assumption = simplify_gen_relational (EQ, SImode,
mode, tmp,
./gcc/loop-iv.c:2176:       assumption = simplify_gen_relational (EQ, SImode,
mode, tmp,
./gcc/loop-iv.c:2260:         may_xform = simplify_gen_relational (cond, SImode,
mode,
./gcc/loop-iv.c:2263:                                                  SImode, mode,
./gcc/loop-iv.c:2272:         may_xform = simplify_gen_relational (cond, SImode,
mode,
./gcc/loop-iv.c:2275:                                                  SImode, mode,
./gcc/loop-iv.c:2325:                                           SImode, mode,
tmp0, tmp1);
./gcc/loop-iv.c:2367:      assumption = simplify_gen_relational (NE, SImode,
mode, tmp, const0_rtx);
./gcc/loop-iv.c:2400:                                               SImode, mode,
./gcc/loop-iv.c:2405:         tmp = simplify_gen_relational (cond, SImode, mode,
t0, t1);
./gcc/loop-iv.c:2406:         assumption = simplify_gen_binary (AND, SImode,
assumption, tmp);
./gcc/loop-iv.c:2412:         assumption = simplify_gen_relational (cond,
SImode, mode,
./gcc/loop-iv.c:2421:                                           SImode, mode,
tmp0, tmp);
./gcc/loop-iv.c:2444:                                               SImode, mode,
./gcc/loop-iv.c:2449:         tmp = simplify_gen_relational (cond, SImode, mode,
t0, t1);
./gcc/loop-iv.c:2450:         assumption = simplify_gen_binary (AND, SImode,
assumption, tmp);
./gcc/loop-iv.c:2456:         assumption = simplify_gen_relational (cond,
SImode, mode,
./gcc/loop-iv.c:2465:                                           SImode, mode,
./gcc/unwind-pe.h:190:      unsigned u4 __attribute__ ((mode (SI)));
./gcc/unwind-pe.h:191:      unsigned u8 __attribute__ ((mode (DI)));
./gcc/unwind-pe.h:193:      signed s4 __attribute__ ((mode (SI)));
./gcc/unwind-pe.h:194:      signed s8 __attribute__ ((mode (DI)));
./gcc/longlong.h:28:   SItype, USItype -- Signed and unsigned 32 bit types.
./gcc/longlong.h:29:   DItype, UDItype -- Signed and unsigned 64 bit types.
./gcc/longlong.h:293:    union {DItype __ll;                                   
                \
./gcc/longlong.h:303:    union {DItype __ll;                                   
                \
./gcc/longlong.h:690:    SItype __m0 = (m0), __m1 = (m1);                      
                \
./gcc/longlong.h:754:    DItype __m0 = (m0), __m1 = (m1);                      
                \
./gcc/longlong.h:808:    (ph) += ((((SItype) __m0 >> 31) & __m1)               
                \
./gcc/longlong.h:809:        + (((SItype) __m1 >> 31) & __m0));                
        \
./gcc/longlong.h:847:      SItype c_;                                          
        \
./gcc/longlong.h:1139:    (xh) += ((((SItype) __m0 >> 31) & __m1)              
                \
./gcc/longlong.h:1140:       + (((SItype) __m1 >> 31) & __m0));                
        \
./gcc/longlong.h:1144:    union {DItype __ll;                                  
                \
./gcc/longlong.h:1145:     struct {SItype __l, __h;} __i;                      
        \
./gcc/unwind-dw2-fde.h:112:typedef          int  sword __attribute__ ((mode (SI)));
./gcc/unwind-dw2-fde.h:113:typedef unsigned int  uword __attribute__ ((mode (SI)));
./gcc/unwind.h:59:typedef unsigned _Unwind_Exception_Class
__attribute__((__mode__(__DI__)));
./gcc/stor-layout.c:165:#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
./gcc/stor-layout.c:1829:  TYPE_MODE (t) = SImode;
./gcc/stor-layout.c:1830:  TYPE_ALIGN (t) = GET_MODE_ALIGNMENT (SImode);
./gcc/stor-layout.c:1834:  TYPE_SIZE (t) = build_int_cst (t, GET_MODE_BITSIZE
(SImode));
./gcc/stor-layout.c:1835:  TYPE_SIZE_UNIT (t) = build_int_cst (t, GET_MODE_SIZE
(SImode));
./gcc/stor-layout.c:1836:  TYPE_PRECISION (t) = GET_MODE_BITSIZE (SImode);
./gcc/stor-layout.c:2015:   larger than LARGEST_MODE (usually SImode).
./gcc/unwind-dw2-fde-glibc.c:211:           signed initial_loc __attribute__
((mode (SI)));
./gcc/unwind-dw2-fde-glibc.c:212:           signed fde __attribute__ ((mode (SI)));
./gcc/tree-ssa-loop-ivopts.c:1825:               build_int_cst
(unsigned_intSI_type_node, 0),
./gcc/tree-ssa-loop-ivopts.c:1826:                       build_int_cst
(unsigned_intSI_type_node, 1),
./gcc/tree-ssa-loop-ivopts.c:1832:                 build_int_cst
(unsigned_intDI_type_node, 0),
./gcc/tree-ssa-loop-ivopts.c:1833:                 build_int_cst
(unsigned_intDI_type_node, 1),
./gcc/ada/utils.c:61:#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
./gcc/ada/utils.c:2309:         build_pointer_type_for_mode (type, SImode,
false), record_type,
./gcc/ada/utils.c:2311:                 build_pointer_type_for_mode (type,
SImode, false),
./gcc/ada/utils.c:2384:             build_pointer_type_for_mode (inner_type,
SImode, false),
./gcc/ada/utils.c:2387:                     build_pointer_type_for_mode
(inner_type, SImode,
./libstdc++-v3/libmath/mathconf.h:73:typedef unsigned int U_int32_t __attribute
((mode (SI)));
./libstdc++-v3/libmath/mathconf.h:74:typedef int Int32_t __attribute ((mode (SI)));
./libstdc++-v3/libmath/mathconf.h:75:typedef unsigned int U_int64_t __attribute
((mode (DI)));
./libstdc++-v3/libmath/mathconf.h:76:typedef int Int64_t __attribute ((mode (DI)));
./libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h:41:  __extension__ typedef int
__guard __attribute__((mode (__DI__)));
./libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h:59:  __extension__ typedef int
__guard __attribute__((mode (__DI__)));
Comment 1 Andrew Pinski 2005-02-09 19:46:07 UTC

*** This bug has been marked as a duplicate of 19537 ***