Re: [PATCH] i386: Add a constraint for absolute symboilc address [PR 105576]

2022-05-18 Thread Hongyu Wang via Gcc-patches
> -fpic will break compilation with "i" constraint. Ah, yes. But "X" is like no constraint, shouldn't we provide something similar to "S" in aarch64 and riscv? I think it is better to constrain the operand to constant symbols rather than allowing everything. Uros Bizjak 于2022年5月18日周三 18:18写道: >

Re: [PATCH] i386: Add a constraint for absolute symboilc address [PR 105576]

2022-05-18 Thread Uros Bizjak via Gcc-patches
On Wed, May 18, 2022 at 12:14 PM Hongyu Wang wrote: > > Oh, I just found that asm ("%p0" :: "i"(addr)); also works on > -mcmodel=large in this case, please ignore this patch. Thanks. -fpic will break compilation with "i" constraint. Uros. > > Uros Bizjak via Gcc-patches 于2022年5月18日周三 17:46写道:

Re: [PATCH] i386: Add a constraint for absolute symboilc address [PR 105576]

2022-05-18 Thread Hongyu Wang via Gcc-patches
Oh, I just found that asm ("%p0" :: "i"(addr)); also works on -mcmodel=large in this case, please ignore this patch. Thanks. Uros Bizjak via Gcc-patches 于2022年5月18日周三 17:46写道: > > On Wed, May 18, 2022 at 9:32 AM Hongyu Wang wrote: > > > > Hi, > > > > This patch adds a constraint "Ws" to allow ab

Re: [PATCH] i386: Add a constraint for absolute symboilc address [PR 105576]

2022-05-18 Thread Uros Bizjak via Gcc-patches
On Wed, May 18, 2022 at 9:32 AM Hongyu Wang wrote: > > Hi, > > This patch adds a constraint "Ws" to allow absolute symbolic address for > either > function or variable. This also works under -mcmodel=large. > > Bootstrapped/regtested on x86_64-pc-linux-gnu{-m32,} > > Ok for master? Maybe you sho

[PATCH] i386: Add a constraint for absolute symboilc address [PR 105576]

2022-05-18 Thread Hongyu Wang via Gcc-patches
Hi, This patch adds a constraint "Ws" to allow absolute symbolic address for either function or variable. This also works under -mcmodel=large. Bootstrapped/regtested on x86_64-pc-linux-gnu{-m32,} Ok for master? gcc/ChangeLog: PR target/105576 * config/i386/constraints.md (Ws):