Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877709 - media-libs/libdv-1.0.0-r4: undefined behavior with aggressive loop optimizations
Summary: media-libs/libdv-1.0.0-r4: undefined behavior with aggressive loop optimizations
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-20 04:59 UTC by Jocelyn Mayer
Modified: 2022-10-20 18:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output from emerge --info =media-libs/libdv-1.0.0-r4 (S1-emerge-infos,25.44 KB, text/plain)
2022-10-20 05:00 UTC, Jocelyn Mayer
Details
Log file for failing merge (libdv-1.0.0-r4:20221020-010526.log,101.44 KB, text/plain)
2022-10-20 05:01 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2022-10-20 04:59:12 UTC
While building libdv using gcc (clang untested) with
 -faggressive-loop-optimizations CFLAG set, I get this kind of message:
iteration 11 invokes undefined behavior in libdv/encode.c

Then, forcing adding -fno-aggressive-loop-optimizations
and -fno--unsafe-loop-optimizations too all flags (for safety) solves the issue.

Reproducible: Always

Steps to Reproduce:
1. Put -faggressive-loop-optimizations -Wno-aggressive-loop-optimizations in compilation flags
2. Emerge libdv
3. See the output
Actual Results:  
I got the 'undefined behavior' warning message

Expected Results:  
It seems better not to have undefined behavior.

The way I did is create a file in /etc/portage/env with the following and use it for libdv adding a reference in /etc/portage/package.env

ADD_FLAGS="-fno-aggressive-loop-optimizations -fno-unsafe-loop-optimizations"
CFLAGS="${CFLAGS} ${ADD_FLAGS} "
CXXFLAGS="${CXXFLAGS} ${ADD_FLAGS}"
FCFLAGS="${FCFLAGS} ${ADD_FLAGS}"
FFLAGS="${FFLAGS} ${ADD_FLAGS}"
LDFLAGS="${LDFLAGS} ${ADD_FLAGS}"
Comment 1 Jocelyn Mayer 2022-10-20 05:00:03 UTC
Created attachment 824819 [details]
output from emerge --info =media-libs/libdv-1.0.0-r4
Comment 2 Jocelyn Mayer 2022-10-20 05:01:51 UTC
Created attachment 824821 [details]
Log file for failing merge