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

            Bug ID: 58716
           Summary: [PATCH] MSP430X check is inverted
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: quandary at remstate dot com
                CC: dj at redhat dot com, nickc at redhat dot com
            Target: msp430-elf

Created attachment 30996
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30996&action=edit
Use !strcasecmp() to detect when a string is matched (instead of strcasecmp())

r203026 added a check for MSP430X arch MCUs based on a complete listing of
supported chips. If a chip is in the list, then the msp430x flag should be set.

The change uses strcasecmp() to accomplish the check, and this function returns
zero on success (match). The "if" statement checking the result of strcasecmp()
is expecting a non-zero value ("true") to trigger the branch.

Fix is to NOT strcasecmp's output. Trivial patch against trunk (head) attached.

Symptom was that code generated for the msp430g2412 chip (non-CPUX) contained
pushm. Verified that the attached patch resolves that issue.

Reply via email to