On Tue, Jul 26, 2011 at 10:21:11PM +0200, Uros Bizjak wrote: > This also works, we look at orig_x that looks like: > > (mem/u/c:SI (const:DI (unspec:DI [ > (symbol_ref:SI ("__sflush") [flags 0x41] > <function_decl 0x7f6f2eaad000 __sflush>) > ] UNSPEC_GOTPCREL)) [2 S4 A8]) > > So, we look at SImode load, and compare it with SImode (actually > ptr_mode) symbol. Will your suggestion work with this RTX?
Then if (GET_MODE (orig_x) != GET_MODE (x)) { x = simplify_gen_subreg (GET_MODE (orig_x), x, GET_MODE (x), 0); if (x == NULL_RTX) return orig_x; } will work, orig_x is the above SImode MEM, x is (symbol_ref:SI ("__sflush") [flags 0x41] <function_decl 0x7f6f2eaad000 __sflush>) thus the modes are the same and no simplify_gen_subreg needs to be done, the mode is already right. Jakub