Ticket #317 (new defect)

Opened 14 months ago

Last modified 13 months ago

Warbling effect..

Reported by: user Owned by: somebody
Priority: minor Milestone:
Component: libzzub Version:
Keywords: Cc: jamesmstone@…

Description

If zzub is compiled with debug=False, a weird warbling effect occurs in some of the generators (Infector, M4WII). If zzub is compiled with debug=True, this effect does not occur.

Change History

Changed 14 months ago by user

it's a gcc bug in some level-2 optimization (-O2).

using -O1 the warbling effect does not occur (as well as setting debug=True, which completely disables optimizations)

the specific optimization causing the problem seems not very well reproducible, as the guilty flag seems to change across gcc releases (4.1.2, 4.1.3_pre20070629, 4.1.3_pre20070812, (...)?)

Changed 13 months ago by user

there are some warnings that may need attention:

src/plugins/m4wii/m4.cpp: In function 'int f2i(double)': src/plugins/m4wii/m4.cpp:153: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/m4wii/m4.cpp: In constructor 'm4wii::m4wii()': src/plugins/m4wii/m4.cpp:3397: warning: dereferencing type-punned pointer might break strict-aliasing rules src/plugins/fsm_infector/DSPChips.h: In function 'int fsm::f2i(double)': src/plugins/fsm_infector/DSPChips.h:1009: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/fsm_infector/infector.cpp: In constructor 'fsm::fsm_infector::fsm_infector()': src/plugins/fsm_infector/infector.cpp:351: warning: dereferencing type-punned pointer might break strict-aliasing rules

other warnings in other files:

src/plugins/green_milk/green_milk.cpp: In constructor 'green_milk::green_milk()': src/plugins/green_milk/green_milk.cpp:441: warning: dereferencing type-punned pointer might break strict-aliasing rules src/plugins/joachims_multi_v2/main.cpp: In constructor 'multi2::multi2()': src/plugins/joachims_multi_v2/main.cpp:222: warning: dereferencing type-punned pointer might break strict-aliasing rules src/plugins/matilde_tracker/Tracker.cpp: In constructor 'CMatildeTrackerMachine::CMatildeTrackerMachine()': src/plugins/matilde_tracker/Tracker.cpp:119: warning: dereferencing type-punned pointer might break strict-aliasing rules src/plugins/SurfsDSPLib/SRF_Resampler.cpp: In function 'float fscale(float, long int)': src/plugins/SurfsDSPLib/SRF_Resampler.cpp:28: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/SurfsDSPLib/SRF_Resampler.cpp:29: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/bigyo_frequencyshifter/Allpass2.h: In member function 'float Allpass2::process(float)': src/plugins/bigyo_frequencyshifter/Allpass2.h:58: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/bigyo_frequencyshifter/Allpass2.h: In member function 'void Allpass2::processSamples(float*, int)': src/plugins/bigyo_frequencyshifter/Allpass2.h:74: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/bigyo_frequencyshifter/Bigyo_FrequencyShifter.cpp: In constructor 'freqshifter::freqshifter()': src/plugins/bigyo_frequencyshifter/Bigyo_FrequencyShifter.cpp:125: warning: dereferencing type-punned pointer might break strict-aliasing rules

IMPORTANT WARNINGS NOT TO IGNORE:

src/plugins/lunar/lunarstd.cpp: In function 'void dsp_amp(float*, int, float)': src/plugins/lunar/lunarstd.cpp:170: warning: operation on 'b' may be undefined src/plugins/lunar/lunarstd.cpp: In function 'void dsp_powmap(float*, int, float, float, float, float)': src/plugins/lunar/lunarstd.cpp:192: warning: operation on 'b' may be undefined src/plugins/lunar/include/lunar/dsp.h: In function 'void dsp_amp(float*, int, float)': src/plugins/lunar/include/lunar/dsp.h:18: warning: operation on 'b' may be undefined src/plugins/lunar/include/lunar/dsp.h: In function 'void dsp_powmap(float*, int, float, float, float, float)': src/plugins/lunar/include/lunar/dsp.h:42: warning: operation on 'b' may be undefined src/plugins/lunar/fx/distortion/distortion.cpp: In member function 'void distortion::process_stereo(float*, float*, float*, float*, int)': src/plugins/lunar/fx/distortion/distortion.cpp:53: warning: operation on 'l' may be undefined src/plugins/lunar/fx/distortion/distortion.cpp:54: warning: operation on 'r' may be undefined src/plugins/bigyo_frequencyshifter/Allpass2.h: In member function 'float Allpass2::process(float)': src/plugins/bigyo_frequencyshifter/Allpass2.h:58: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/bigyo_frequencyshifter/Allpass2.h: In member function 'void Allpass2::processSamples(float*, int)': src/plugins/bigyo_frequencyshifter/Allpass2.h:74: warning: dereferencing type-punned pointer will break strict-aliasing rules src/plugins/bigyo_frequencyshifter/Bigyo_FrequencyShifter.cpp: In constructor 'freqshifter::freqshifter()': src/plugins/bigyo_frequencyshifter/Bigyo_FrequencyShifter.cpp:125: warning: dereferencing type-punned pointer might break strict-aliasing rules

Changed 13 months ago by user

sorry, the formatting in the previous post is bad, and the last few warnings are actually not "undefined behaviour", but "strict-aliasing rule breakage", the latter i'm not sure whether they lead to boggus code or not.

Changed 13 months ago by user

after checking gcc's doc, i can confirm that the warning "dereferencing type-punned pointer might break strict-aliasing rules" is actually an indication that the generated code might not work as excepted. So, this would mean all those warnings are potential bugs.

Note: See TracTickets for help on using tickets.