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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
      if ((code1 == STRING_CST && !integer_zerop (arg2.value))
          || (code2 == STRING_CST && !integer_zerop (arg1.value)))
        warning_at (location, OPT_Waddress,
                    "comparison with string literal results in unspecified
behavior");

(gdb) p code1
$1 = STRING_CST
(gdb) p code2
$2 = ERROR_MARK
(gdb) p debug_generic_expr (arg1.value)
(char *) "Should not call this function"
$3 = void
(gdb) p debug_generic_expr (arg2.value)
0B

(gdb) p integer_zerop (arg2.value)
$6 = 0

huh?

Ah.

(gdb) p debug_tree (arg2.value)
 <nop_expr 0x7ffff69b2000
    type <pointer_type 0x7ffff68adbd0
        type <integer_type 0x7ffff688f5e8 char public string-flag QI
            size <integer_cst 0x7ffff688bd98 constant 8>
            unit size <integer_cst 0x7ffff688bdb0 constant 1>
            align 8 symtab 0 alias set -1 canonical type 0x7ffff688f5e8
precision 8 min <integer_cst 0x7ffff688bde0 -128> max <integer_cst
0x7ffff688be10 127>
            pointer_to_this <pointer_type 0x7ffff68adbd0>>
        public unsigned DI
        size <integer_cst 0x7ffff688bca8 constant 64>
        unit size <integer_cst 0x7ffff688bcc0 constant 8>
        align 64 symtab 0 alias set -1 canonical type 0x7ffff68adbd0
reference_to_this <reference_type 0x7ffff698d7e0>>
    constant
    arg 0 <integer_cst 0x7ffff699f2e8 type <pointer_type 0x7ffff68adbd0>
constant 0>
    t.c:4:39 start: t.c:4:39 finish: t.c:4:58>

some spurious NOP_EXPR around the constant.  Why's that?

Reply via email to