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

--- Comment #23 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-04 10:58:03 
UTC ---
Compiling testcase from comment 0, -O0:

(gdb) b builtins.c:3830
Breakpoint 1 at 0x522c91: file ../../gcc-svn/trunk/gcc/builtins.c, line 3830.
(gdb) r
Starting program: /home/uros/gcc-build-xxx/gcc/cc1 -O0 ttt.c
 d_unqualified_name
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <early_local_cleanups>
<whole-program>Assembling functions:
 d_unqualified_name
Breakpoint 1, expand_builtin_strcmp (exp=0x7ffff19a5b88, target=0x7ffff1ace360)
    at ../../gcc-svn/trunk/gcc/builtins.c:3830
3830              if (len1)

(gdb) li
3827              tree len1 = c_strlen (arg1, 1);
3828              tree len2 = c_strlen (arg2, 1);
3829
3830              if (len1)

(gdb) p insn_mode
$1 = VOIDmode

(gdb) p insn_data[2829]
$2 = {name = 0xdc80ab "cmpstrnsi", output = {single = 0x0, multi = 0x0,
function = 0}, 
  genfun = 0x623d95 <gen_cmpstrnsi(rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*)>, 
  operand = 0xe09e98, n_generator_args = 5 '\005', n_operands = 5 '\005',
n_dups = 0 '\000', 
  n_alternatives = 0 '\000', output_format = 0 '\000'}

(gdb) p insn_data[2829].operand[0].mode
$3 = SImode

But...

      enum machine_mode insn_mode
        = insn_data[(int) CODE_FOR_cmpstrnsi].operand[0].mode;
      tree len1 = c_strlen (arg1, 1);
      tree len2 = c_strlen (arg2, 1);

Something is seriously broken here. insn_mode should get SImode, not VOIDmode.

Reply via email to