gcl-devel
[Top][All Lists]
Advanced

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

gcc-12 miscompilation


From: Camm Maguire
Subject: gcc-12 miscompilation
Date: Sat, 24 Dec 2022 17:27:52 -0500

Greetings, and thank you so much for pinning down the offending
optimization flag, reducing the bug report, and forwarding the response!

I'm not convinced (yet at least) that this code being classified as
'undefined' means gcc is not in error.  Signed and unsigned integer
arithmetic of any precision is defined in C to loop around extremal
values, i.e. to act as modular operations.  This code acknowledges this
and relies upon it -- runtime 'overflows' are not a mistake.  Perhaps
there is some better syntax to make this clear?

> I have discovered that adding -fno-tree-vrp to the build flags makes
> your example compile successfully (found by doing a binary search on
> the optimization flags added between -O1, where the example works, and
> -O2, where it does not).

I've confirmed that adding this flag restores gcl to successful support
of maxima, where the error first appeared.  It would be simple to add
this as a workaround in configure, but it still seems fragile, and gcc
still seems (to me) in need of repair here.

Take care,
-- 
Camm Maguire                                        camm@maguirefamily.org
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]