Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: "insn does not satisfy its constraints" compiling perl



Hi Kalvis,

On Tue, 2026-03-03 at 16:20 +1100, Kalvis Duckmanton wrote:
> > I'll try to reproduce it with GCC 15.2.0 and file an upstream bug report
> > if it's reproducible there.
> 
> Some observations which may be helpful (bearing in mind that I'm not an 
> expert!):

That was an excellent analysis though ;-).

> This problem also appears when cross-compiling.

I was expecting that.

> I was able to generate a reduced test case 
> (https://www.netbsd.org/~kalvisd/11.0rc1-gcc-12.5.0-vax-perl-insn-constraints-toke-reduced.i)
> 
> I wasn't able to reproduce the problem in GCC 14.3.0 (from 
> NetBSD-current) or GCC 15.2.0 from upstream, either with the reduced 
> test case or the original 'toke.i'.

This is good news and I was somewhat expecting that due to the many improvements
that the VAX backend received around the GCC 12 release.

> After a bit of debugging, it seems that GCC 12 found that the output 
> operand for the '*extzv_aligned_2' instruction pattern conflicts with 
> one of the input operands.  The input operands in this case are 2 
> constants and an operand that is either a register or a memory address 
> (not using pre/post increment or decrement addressing modes).  The 
> output operand has the 'earlyclobber' constraint, indicating that it is 
> modified before the instruction has finished using the input operands, 
> so the output may not be in a register that's used as an input operand 
> or as part of any memory address.
> 
> The constraints on '*extzv_aligned_2' are unchanged in GCC 15.2.0.
> 
> The output operands of the related '*extv_aligned' patterns do not have 
> the 'earlyclobber' constraint.
> 
> '*extzv_aligned_2' emits a move instruction and none of the move 
> instruction patterns' output operands have the 'earlyclobber' constraint.
> 
> I'm not sure that I understand why the 'earlyclobber' constraint is 
> applied to the output operand of '*extzv_aligned_2'.  If I remove the 
> 'earlyclobber' constraint, GCC 12.5.0 compiles both the reduced test 
> case and the original 'toke.i' without incident. (Also the NetBSD 
> distribution, but it did that before.)

I'm not sure whether it makes much sense to debug the problem in detail,
as interesting as it sounds, when you confirm the issue is not present in
GCC 14.

How difficult is it to switch the default compiler for a NetBSD installation
from 12 to 14? If it doesn't involve much, I would recommend doing that.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Home | Main Index | Thread Index | Old Index