Bug 143895 - perl, libperl gets screwed by -fsched2-use-superblocks; a case for flag-o-matic?
Bug#: 143895 Product:  Gentoo Linux Version: 2006.0 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P1
Resolution: FIXED Assigned To: perl@gentoo.org Reported By: sg313d@gmail.com
Component: Core system
URL: 
Summary: perl, libperl gets screwed by -fsched2-use-superblocks; a case for flag-o-matic?
Keywords:  
Status Whiteboard: 
Opened: 2006-08-14 09:47 0000
Description:   Opened: 2006-08-14 09:47 0000
perl and libperl don't like the optimization flag -fsched2-use-superblocks in
conjunction with -O2 or higher on gcc-4.1.1. 
This causes perl 'require vX.Y.Z' to fail for versions ending with .0 (Z=0),
for example a perl-5.8.8 installation exit with an error from 
perl -e 'require v5.6.0'; 
On gcc-3.4.6 these malfunctions couldn't be observed.

Description:
The optimization damages loop code in str_to_version. As a consequence the
command >>perl -e require 'vX.Y.0'<< will fail for any values of X,Y;
This seems to be version of a (well) known bug on gcc-bugzilla. They closed
it as wontfix.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 for details.
If are convinced that this is a another bug, feel free to file it at
the gcc-bugzilla.

Steps to reproduce:
1. Compile libperl/perl >= 5.8 with gcc-4.1.1, -O2 & -fsched2-use-superblocks.
2. perl -e 'require 5.6.0' -> Will abort with error (!)

Proposed solution:
This can be easyly circumvented by using flag-o-matic to  strip
-fsched2-use-superblocks from CFLAGS.
Patches for perl and libperl ebuilds are attached.

------- Comment #1 From sg313 2006-08-14 09:51:42 0000 -------
Created an attachment (id=94253) [details]
Filters -fsched2-use-superblocks for perl

s.o.

------- Comment #2 From sg313 2006-08-14 09:52:32 0000 -------
Created an attachment (id=94254) [details]
Filters -fsched2-use-superblocks for libperl

s.o.

------- Comment #3 From Jakub Moc (RETIRED) 2006-08-14 10:23:34 0000 -------
Quite frankly, we really have better things to do that to filter whatever
ultraweird flag that someone has stuck into his flags for whatever reason. How
about that you filter it yourself?

------- Comment #4 From sg313 2006-08-14 10:41:32 0000 -------
The report was not meant to be an offense. Discard it if you want;
I just wanted to share the solution.

------- Comment #5 From Christian Hartmann 2006-08-15 06:48:59 0000 -------
Fixed in cvs.

------- Comment #6 From sg313 2006-08-15 09:23:41 0000 -------
Thanks!