http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55093

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-10-28 03:22:31 
UTC ---
A small testcase:

[hjl@gnu-tools-1 pr55093]$ cat x.ii 
__extension__ typedef struct {
}
_G_fpos_t;
typedef unsigned int hashval_t;
typedef union tree_node *tree;
typedef union gimple_statement_d *gimple;
typedef const union tree_node *const_tree;
typedef struct edge_def *edge;
enum machine_mode { VOIDmode,        };
struct double_int {
    unsigned long long low;
    long long high;
};
struct real_value {
};
struct real_format {
    bool has_signed_zero;
};
extern const struct real_format *   real_format_for_mode[1];
extern bool real_isnegzero (const struct real_value *);
enum tree_code { REAL_CST, SSA_NAME };
struct tree_base {
    enum tree_code code : 16;
    union {
        unsigned int version;
    }
    u;
};
extern void tree_check_failed (const_tree, const char *, int, const char *,    
      ...) __attribute__ ((__noreturn__));
typedef struct ssa_use_operand_d {
    union {
    }
    loc;
}
ssa_use_operand_t;
union                                                          tree_node {
    struct tree_base base;
};
inline tree tree_check (tree __t, const char *__f, int __l, const char *__g,
tree_code __c) {
    if (((enum tree_code) (__t)->base.code) != __c)     tree_check_failed (__t,
__f, __l, __g, __c, 0);
    union basic_block_il_dependent {
    }
    il;
}
typedef enum {
}
gimple_stmt_iterator;
enum ssa_prop_result {
    SSA_PROP_NOT_INTERESTING,     SSA_PROP_INTERESTING,     SSA_PROP_VARYING };
typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (gimple, edge *, tree
*);
typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (gimple);
typedef bool (*ssa_prop_fold_stmt_fn) (gimple_stmt_iterator *gsi);
typedef tree (*ssa_prop_get_value_fn) (tree);
void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn, bool);
typedef enum {
    UNINITIALIZED,   UNDEFINED,   CONSTANT,   VARYING }
    ccp_lattice_t;
    struct prop_value_d {
        ccp_lattice_t lattice_val;
        tree value;
        double_int mask;
    };
typedef struct prop_value_d prop_value_t;
static prop_value_t *const_val;
static void canonicalize_float_value (prop_value_t *);
static bool ccp_fold_stmt (gimple_stmt_iterator *);
static inline prop_value_t * get_value (tree var) {
    prop_value_t *val;
    canonicalize_float_value (val);
}
static inline tree get_constant_value (tree var) {
    prop_value_t *val;
    val = get_value (var);
}
static void canonicalize_float_value (prop_value_t *val) {
    enum machine_mode mode;
    struct real_value d;
    if (val->lattice_val != CONSTANT      || ((enum tree_code)
(val->value)->base.code) != REAL_CST)      return;
    if (!(((real_format_for_mode[ mode      ])->has_signed_zero))      &&
real_isnegzero (&d)      )     {
    }
}
static bool set_lattice_value (tree var, prop_value_t new_val) {
    prop_value_t *old_val = &const_val[(tree_check ((var), "",
    0, __FUNCTION__, (SSA_NAME)))->base.u.version];
    canonicalize_float_value (&new_val);
}
static enum ssa_prop_result ccp_visit_phi_node (gimple phi) {
    prop_value_t new_val;
    if (set_lattice_value (0, new_val))     {
    }
}
static enum ssa_prop_result ccp_visit_stmt (gimple stmt, edge *taken_edge_p,
tree *output_p) {
    tree def;
    prop_value_t v = {
    };
    set_lattice_value (def, v);
}
unsigned int do_ssa_ccp (void) {
    ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
    substitute_and_fold (get_constant_value, ccp_fold_stmt, true);
}
[hjl@gnu-tools-1 pr55093]$ make
/usr/gcc-4.8.0-x32/bin/gcc -O2 -mx32 -maddress-mode=long -S x.ii
x.ii: In function ‘bool set_lattice_value(tree, prop_value_t)’:
x.ii:87:1: internal compiler error: in print_reg, at config/i386/i386.c:14088
 }
 ^
0xcb3e48 print_reg(rtx_def*, int, _IO_FILE*)
    /export/gnu/import/git/gcc/gcc/config/i386/i386.c:14083
0xcb4185 ix86_print_operand_address
    /export/gnu/import/git/gcc/gcc/config/i386/i386.c:15046
0x8799ee output_address(rtx_def*)
    /export/gnu/import/git/gcc/gcc/final.c:3709
0xcba9cf ix86_print_operand(_IO_FILE*, rtx_def*, int)
    /export/gnu/import/git/gcc/gcc/config/i386/i386.c:14825
0x87994e output_operand(rtx_def*, int)
    /export/gnu/import/git/gcc/gcc/final.c:3693
0x87a284 output_asm_insn(char const*, rtx_def**)
    /export/gnu/import/git/gcc/gcc/final.c:3572
0x87b8fa final_scan_insn(rtx_def*, _IO_FILE*, int, int, int*)
    /export/gnu/import/git/gcc/gcc/final.c:2890
0x87c085 final(rtx_def*, _IO_FILE*, int)
    /export/gnu/import/git/gcc/gcc/final.c:1919
0x87c469 rest_of_handle_final
    /export/gnu/import/git/gcc/gcc/final.c:4321
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [x.s] Error 1
[hjl@gnu-tools-1 pr55093]$

Reply via email to