public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/67839] New: Bit addressable instructions generated for invalid memory address
@ 2015-10-04 13:04 senthil_kumar.selvaraj at atmel dot com
2015-10-05 9:04 ` [Bug target/67839] " senthil_kumar.selvaraj at atmel dot com
2015-10-28 17:36 ` denisc at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: senthil_kumar.selvaraj at atmel dot com @ 2015-10-04 13:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67839
Bug ID: 67839
Summary: Bit addressable instructions generated for invalid
memory address
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: senthil_kumar.selvaraj at atmel dot com
Target Milestone: ---
Bit addressable instructions (sbi, cbi, sbis, sbic) only work on IO addresses
0x0-0x1f (inclusive). The compiler generates these instructions for IO address
0x20 as well.
The problem is in the specification of low_io_address_operand predicate, which
has
(define_special_predicate "low_io_address_operand"
(ior (and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op) - avr_arch->sfr_offset,
0, 0x20 - GET_MODE_SIZE (mode))"))
(and (match_code "symbol_ref")
(match_test "SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_IO_LOW"))))
While this looks ok, gcc invokes low_io_address_operand with mode set to VOID,
and GET_MODE_SIZE for VOID returns 0, so the effective range becomes 0x0-0x20.
gcc does pass the correct mode if the operand mode is set in the define_insn
that uses this predicate. Don't know why it isn't set, and why
define_special_predicate is used instead of define_predicate.
Note that io_address_operand predicate has a GET_MODE_SIZE call as well, so the
range check is off by one in it too
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-28 17:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-04 13:04 [Bug target/67839] New: Bit addressable instructions generated for invalid memory address senthil_kumar.selvaraj at atmel dot com
2015-10-05 9:04 ` [Bug target/67839] " senthil_kumar.selvaraj at atmel dot com
2015-10-28 17:36 ` denisc at gcc dot gnu.org
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).