Re: gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Jelinek
Date: Monday, November 15, 2010 - 11:58 am

On Mon, Nov 15, 2010 at 07:30:35PM +0100, Jim Bos wrote:

Thanks, this actually helped to see the problem.
The problem is not inside of i8k_smm, which is not inlined, but in the
callers.
ipa-pure-const.c pass thinks i8k_smm is a pure function, thus
regs = {};
regs.eax = 166;
x = i8k_smm (&regs);
if (!x) x = regs.eax;
in the callers is optimized into
regs = {}
regs.eax = 166;
x = i8k_smm (&regs);
if (!x) x = 166;
Now, not sure why this happens, as there is
    case GIMPLE_ASM:
      for (i = 0; i < gimple_asm_nclobbers (stmt); i++)
        {
          tree op = gimple_asm_clobber_op (stmt, i);
          if (simple_cst_equal(TREE_VALUE (op), memory_identifier_string) == 1)
            {
              if (dump_file)
                fprintf (dump_file, "    memory asm clobber is not const/pure");
              /* Abandon all hope, ye who enter here. */
              local->pure_const_state = IPA_NEITHER;
            }
        }
Debugging...

	Jakub
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] i8k: Tell gcc that *regs gets clobbered, Jim Bos, (Sat Nov 13, 4:13 am)
Re: gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/ ..., Jakub Jelinek, (Mon Nov 15, 11:58 am)
Re: gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/ ..., Richard Henderson, (Mon Nov 15, 12:53 pm)