public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "czimman at bloomberg dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/23980] Bad assembly output in Thumb mode with -O2
Date: Tue, 20 Sep 2005 17:25:00 -0000	[thread overview]
Message-ID: <20050920172535.10999.qmail@sourceware.org> (raw)
In-Reply-To: <20050920161531.23980.czimman@bloomberg.com>


------- Additional Comments From czimman at bloomberg dot com  2005-09-20 17:25 -------
-Wall gives a warning about i not being used, but that's it.  We normally 
always build with -Wall enabled.

Here's the preprocessed output:

int
mmcsd_read(void * dst, void * src, unsigned int len)
{
    int return_val = NETI_OK;
    int i = 0;

    cyg_mutex_lock(&mmcsd.mutex);

    if(!mmcsd.card_initialized) {
 cyg_mutex_unlock(&mmcsd.mutex);
 printf("mmcsd_read(buf, 0x%x, %d) returnign error\n",(unsigned int) src, len);
 return NETI_MMCSD_CARD_UNINITIALIZED;
    }

    *((volatile CYG_WORD32 *)(({ CYG_ADDRWORD _p = (CYG_ADDRWORD)(0x00214000 + 
0x24); if (_p >= 0x12000000 && _p < (0x12000000 +0x00400000)) _p = (_p & 
(0x00400000 -1)) + 0x00000000; else if (_p >= 0x00200000 && _p < (0x00200000 
+0x00100000)) _p = (_p & (0x00100000 -1)) + 0xA0000000; _p; }))) |= ((1 << 6));

    disconnect_card_detect_pullup();

    if(!len) {
 cyg_mutex_unlock(&mmcsd.mutex);

 printf("mmcsd_read(buf, 0x%x, %d) returning len = 0\n",(unsigned int) src, 
len);

 return NETI_OK;
    }
    if((((unsigned int)src)/512 + len/512) > mmcsd.device_size) {
 cyg_mutex_unlock(&mmcsd.mutex);

 printf("mmcsd_read(buf, 0x%x, %d) returnign error\n",(unsigned int) src, len);

 return NETI_MMCSD_INVALID_CARD_ADDRESS;
    }

    if(len % 512) {
 cyg_mutex_unlock(&mmcsd.mutex);

 printf("mmcsd_read(buf, 0x%x, %d) returnign error\n",(unsigned int) src, len);

 return NETI_MMCSD_INVALID_CARD_ADDRESS;
    }

    if(((unsigned int)src) % 512) {
 cyg_mutex_unlock(&mmcsd.mutex);

 printf("mmcsd_read(buf, 0x%x, %d) returnign error\n",(unsigned int) src, len);

 return NETI_MMCSD_INVALID_CARD_ADDRESS;
    }

    if((return_val = mmcsd_dma_read_blks(dst, (unsigned int) src, len/512)) != 
NETI_OK) {
 cyg_mutex_unlock(&mmcsd.mutex);

 printf("mmcsd_read(buf, 0x%x, %d) returnign error\n",(unsigned int) src, len);

 return return_val;
    }

    connect_card_detect_pullup();
    *((volatile CYG_WORD32 *)(({ CYG_ADDRWORD _p = (CYG_ADDRWORD)(0x00214000 + 
0x24); if (_p >= 0x12000000 && _p < (0x12000000 +0x00400000)) _p = (_p & 
(0x00400000 -1)) + 0x00000000; else if (_p >= 0x00200000 && _p < (0x00200000 
+0x00100000)) _p = (_p & (0x00100000 -1)) + 0xA0000000; _p; }))) = *((volatile 
CYG_WORD32 *)(({ CYG_ADDRWORD _p = (CYG_ADDRWORD)(0x00214000 + 0x24); if (_p >= 
0x12000000 && _p < (0x12000000 +0x00400000)) _p = (_p & (0x00400000 -1)) + 
0x00000000; else if (_p >= 0x00200000 && _p < (0x00200000 +0x00100000)) _p = 
(_p & (0x00100000 -1)) + 0xA0000000; _p; }))) & ~((1 << 6));

    cyg_mutex_unlock(&mmcsd.mutex);

    return return_val;
}


-- 


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


  parent reply	other threads:[~2005-09-20 17:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-20 16:15 [Bug c/23980] New: " czimman at bloomberg dot com
2005-09-20 16:18 ` [Bug target/23980] " pinskia at gcc dot gnu dot org
2005-09-20 16:21 ` pinskia at gcc dot gnu dot org
2005-09-20 17:25 ` czimman at bloomberg dot com [this message]
2005-09-30  9:21 ` rearnsha at gcc dot gnu dot org
     [not found] <bug-23980-11386@http.gcc.gnu.org/bugzilla/>
2005-10-07 14:53 ` czimman at bloomberg dot com
2005-10-07 15:51 ` rearnsha at gcc dot gnu dot org
2005-10-07 15:55 ` czimman at bloomberg dot com
2005-10-07 15:57 ` rearnsha at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050920172535.10999.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).