This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14302] New: arm-linux g++ error


Compile error:

/tmp/x.cpp: In function `void ApplySoundXform(S16*, int, long int, const
   SoundXform&)':
/tmp/x.cpp:31: error: insn does not satisfy its constraints:
(insn:HI 109 87 90 0x4027e6e0 (set (reg:HI 1 r1 [73])
        (mem:HI (label_ref 208) [0 S2 A16])) 185 {*movhi_insn_arch4}
(insn_list:REG_DEP_ANTI 79 (insn_list:REG_DEP_OUTPUT 78 (nil)))
    (nil))
/tmp/x.cpp:31: internal compiler error: in final_scan_insn, at final.c:2722
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


x.cpp:

typedef signed long S32;
typedef signed short S16;
struct SoundXform {
public:
        int rl;
        int rr;
};

void ApplySoundXform(S16 *buf, int samples,
                     S32 vol,
                     const SoundXform &soundXform
                     )
{
        int loopCount = samples;
        int i;
        S32 volumeSound = vol;
        S32 RRsound = soundXform.rr;
        S32 RLsound = soundXform.rl;

        for (i = 0; i < loopCount; i+= 2)
        {
                S32 left = buf[i];
                S32 right = buf[i+1];

                S32 leftOut = left;
                S32 rightOut = ((left * RLsound + right * RRsound) * volumeSound);

                        buf[i] = leftOut < 0 ? (int)-32768 : (int)32767;
                        buf[i+1] = rightOut < 0 ? (int)-32768 : (int)32767;
        }
}


Command line:
arm-linux-g++ -O2 -fPIC /tmp/x.cpp

The problem seems to go away for -mcpu=arm7, or with less than -O2 optimization,
or without -fPIC.  I suppose it just happens to generate a bad RTL when
everything lines up just wrong...

Marcus Hall
marcus@tuells.org

-- 
           Summary: arm-linux g++ error
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marcus at tuells dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86-linux
  GCC host triplet: x86-linux
GCC target triplet: arm-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14302


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]